diff options
Diffstat (limited to 'generate/unix/Makefile.config')
-rw-r--r-- | generate/unix/Makefile.config | 87 |
1 files changed, 49 insertions, 38 deletions
diff --git a/generate/unix/Makefile.config b/generate/unix/Makefile.config index 5a42cc84184c..65242e0a9832 100644 --- a/generate/unix/Makefile.config +++ b/generate/unix/Makefile.config @@ -19,12 +19,16 @@ # # Configuration +# +# OPT_CFLAGS can be overridden on the make command line by +# adding OPT_CFLAGS="..." to the invocation. +# # Notes: # $(BITS) must be set to either 32 or 64 # gcc should be version 4 or greater, otherwise some of the options # used will not be recognized. -# Global optimization flags (such as -O2, -Os) are not used, since -# they cause issues on some compilers. +# Global optimization flags (such as -O2, -Os) may cause issues on +# some compilers. # The _GNU_SOURCE symbol is required for many hosts. # .SUFFIXES : @@ -38,7 +42,7 @@ CC = gcc OBJDIR = obj$(BITS) BINDIR = bin$(BITS) BITSFLAG = -m$(BITS) -COMPILEOBJ = $(CC) -c $(CFLAGS) $(CWARNINGFLAGS) -o$@ $< +COMPILEOBJ = $(CC) -c $(CFLAGS) $(OPT_CFLAGS) -o $@ $< LINKPROG = $(CC) $(OBJECTS) -o $(PROG) $(LDFLAGS) INSTALLDIR = /usr/bin INSTALLPROG = install -D ../$(BINDIR)/$(PROG) $(DESTDIR)$(INSTALLDIR)/$(PROG) @@ -100,58 +104,65 @@ ACPICA_HEADERS = \ $(wildcard $(ACPICA_INCLUDE)/platform/*.h) # -# Common compiler flags. The warning flags in addition to -Wall are not -# automatically included in -Wall. +# Common compiler flags # +OPT_CFLAGS ?= \ + -D_FORTIFY_SOURCE=2\ + -O2\ + $(CWARNINGFLAGS) + CFLAGS += \ - $(BITSFLAG) \ - -D$(HOST) \ - -D_GNU_SOURCE \ - -D_FORTIFY_SOURCE=2 \ + $(BITSFLAG)\ + -D$(HOST)\ + -D_GNU_SOURCE\ -I$(ACPICA_INCLUDE) LDFLAGS += $(BITSFLAG) +# +# Common compiler warning flags. The warning flags in addition +# to -Wall are not automatically included in -Wall. +# CWARNINGFLAGS = \ - -ansi \ - -Wall \ - -Wbad-function-cast \ - -Wdeclaration-after-statement \ - -Werror \ - -Wformat=2 \ - -Wmissing-declarations \ - -Wmissing-prototypes \ - -Wstrict-aliasing=0 \ - -Wstrict-prototypes \ - -Wswitch-default \ - -Wpointer-arith \ + -ansi\ + -Wall\ + -Wbad-function-cast\ + -Wdeclaration-after-statement\ + -Werror\ + -Wformat=2\ + -Wmissing-declarations\ + -Wmissing-prototypes\ + -Wstrict-aliasing=0\ + -Wstrict-prototypes\ + -Wswitch-default\ + -Wpointer-arith\ -Wundef # -# gcc 4+ flags +# Additional gcc 4+ warning flags # CWARNINGFLAGS += \ - -Waddress \ - -Waggregate-return \ - -Wchar-subscripts \ - -Wempty-body \ - -Wlogical-op \ - -Wmissing-declarations \ - -Wmissing-field-initializers \ - -Wmissing-parameter-type \ - -Wnested-externs \ - -Wold-style-declaration \ - -Wold-style-definition \ - -Wredundant-decls \ + -Waddress\ + -Waggregate-return\ + -Wchar-subscripts\ + -Wempty-body\ + -Wlogical-op\ + -Wmissing-declarations\ + -Wmissing-field-initializers\ + -Wmissing-parameter-type\ + -Wnested-externs\ + -Wold-style-declaration\ + -Wold-style-definition\ + -Wredundant-decls\ -Wtype-limits # -# Extra warning flags (possible future use) +# Extra warning flags (for possible future use) # #CWARNINGFLAGS += \ -# -Wcast-qual \ -# -Wconversion -# -Wshadow \ +# -Wcast-qual\ +# -Wconversion\ +# -Wshadow\ # # Bison/Flex configuration |