blob: 718b403a455e449c2d950dcab7f63eff7cfe1436 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001# Maple SDK requires C99
2EXTRA_CFLAGS += -Wall -Werror
3ARFLAGS = r
4
5BLD_CC = $(CCACHE) $(CROSS_COMPILE)gcc
6BLD_AS = $(CCACHE) $(CROSS_COMPILE)gcc
7BLD_AR = $(CROSS_COMPILE)ar
8BLD_DEP = $(BLD_CC)
9
10CFLAGS += -std=c99
11ifeq ("$(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
17endif
18
19BUILD_DEPS_IN_CC ?= y
20export BUILD_DEPS_IN_CC
21
22ifeq ("$(BUILD_DEPS_IN_CC)", "y")
23 CFLAGS += -MMD -MP
24endif
25
26ifeq ("$(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
34endif
35
36ifeq ("$(EXPORT_DYNAMIC_SYMBOLS)", "y")
37 ARCH_FLAGS += -Wl,-export-dynamic
38endif
39
40ifneq ("$(SIMULATION_BUILD)", "y")
41 EXTRA_CFLAGS += -Wframe-larger-than=16384
42endif
43
44LIBS_MARKER =-l
45LIBS_PATH_MARKER =-L
46LIBS_START_MARKER = -Wl,--start-group
47LIBS_END_MARKER = -Wl,--end-group
48
49# Debug and release optimization options. Can be overwritten in Makefile.config.$(PLATFORM)
50DEBUG_O_CFLAGS ?= -g -ggdb -O0
51DEBUG_O_LFLAGS ?= -g
52RELEASE_O_CFLAGS ?= -g -O2
53RELEASE_O_LFLAGS ?= -g