Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame^] | 1 | # Maple SDK requires C99 |
| 2 | EXTRA_CFLAGS += -Wall -Werror |
| 3 | ARFLAGS = r |
| 4 | |
| 5 | BLD_CC = $(CCACHE) $(CROSS_COMPILE)gcc |
| 6 | BLD_AS = $(CCACHE) $(CROSS_COMPILE)gcc |
| 7 | BLD_AR = $(CROSS_COMPILE)ar |
| 8 | BLD_DEP = $(BLD_CC) |
| 9 | |
| 10 | CFLAGS += -std=c99 |
| 11 | ifeq ("$(ENABLE_EXTRA_WARNINGS)", "y") |
| 12 | CFLAGS += -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts |
| 13 | CFLAGS += -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls |
| 14 | CFLAGS += -Wstrict-prototypes -Wparentheses -Wswitch -Wswitch-default -Wunused -Wuninitialized -Wunused-but-set-variable |
| 15 | CFLAGS += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare |
| 16 | CFLAGS += -Wshadow -Wno-inline |
| 17 | endif |
| 18 | |
| 19 | BUILD_DEPS_IN_CC ?= y |
| 20 | export BUILD_DEPS_IN_CC |
| 21 | |
| 22 | ifeq ("$(BUILD_DEPS_IN_CC)", "y") |
| 23 | CFLAGS += -MMD -MP |
| 24 | endif |
| 25 | |
| 26 | ifeq ("$(CROSS_COMPILE)", "") |
| 27 | ARCH_FLAGS += -m32 -march=i386 |
| 28 | SIMULATION_BUILD ?= y |
| 29 | export SIMULATION_BUILD |
| 30 | GCCVER ?= 4.8.1 |
| 31 | export GCCVER |
| 32 | # Temporary, until bad cast in bcm_dev_log_task.c is fixed (SWMAPLE-2123) |
| 33 | CFLAGS += -Wno-strict-aliasing |
| 34 | endif |
| 35 | |
| 36 | ifeq ("$(EXPORT_DYNAMIC_SYMBOLS)", "y") |
| 37 | ARCH_FLAGS += -Wl,-export-dynamic |
| 38 | endif |
| 39 | |
| 40 | ifneq ("$(SIMULATION_BUILD)", "y") |
| 41 | EXTRA_CFLAGS += -Wframe-larger-than=16384 |
| 42 | endif |
| 43 | |
| 44 | LIBS_MARKER =-l |
| 45 | LIBS_PATH_MARKER =-L |
| 46 | LIBS_START_MARKER = -Wl,--start-group |
| 47 | LIBS_END_MARKER = -Wl,--end-group |
| 48 | |
| 49 | # Debug and release optimization options. Can be overwritten in Makefile.config.$(PLATFORM) |
| 50 | DEBUG_O_CFLAGS ?= -g -ggdb -O0 |
| 51 | DEBUG_O_LFLAGS ?= -g |
| 52 | RELEASE_O_CFLAGS ?= -g -O2 |
| 53 | RELEASE_O_LFLAGS ?= -g |