blob: 718b403a455e449c2d950dcab7f63eff7cfe1436 [file] [log] [blame]
# Maple SDK requires C99
EXTRA_CFLAGS += -Wall -Werror
ARFLAGS = r
BLD_CC = $(CCACHE) $(CROSS_COMPILE)gcc
BLD_AS = $(CCACHE) $(CROSS_COMPILE)gcc
BLD_AR = $(CROSS_COMPILE)ar
BLD_DEP = $(BLD_CC)
CFLAGS += -std=c99
ifeq ("$(ENABLE_EXTRA_WARNINGS)", "y")
CFLAGS += -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts
CFLAGS += -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls
CFLAGS += -Wstrict-prototypes -Wparentheses -Wswitch -Wswitch-default -Wunused -Wuninitialized -Wunused-but-set-variable
CFLAGS += -Wno-unused-parameter -Wno-missing-field-initializers -Wno-sign-compare
CFLAGS += -Wshadow -Wno-inline
endif
BUILD_DEPS_IN_CC ?= y
export BUILD_DEPS_IN_CC
ifeq ("$(BUILD_DEPS_IN_CC)", "y")
CFLAGS += -MMD -MP
endif
ifeq ("$(CROSS_COMPILE)", "")
ARCH_FLAGS += -m32 -march=i386
SIMULATION_BUILD ?= y
export SIMULATION_BUILD
GCCVER ?= 4.8.1
export GCCVER
# Temporary, until bad cast in bcm_dev_log_task.c is fixed (SWMAPLE-2123)
CFLAGS += -Wno-strict-aliasing
endif
ifeq ("$(EXPORT_DYNAMIC_SYMBOLS)", "y")
ARCH_FLAGS += -Wl,-export-dynamic
endif
ifneq ("$(SIMULATION_BUILD)", "y")
EXTRA_CFLAGS += -Wframe-larger-than=16384
endif
LIBS_MARKER =-l
LIBS_PATH_MARKER =-L
LIBS_START_MARKER = -Wl,--start-group
LIBS_END_MARKER = -Wl,--end-group
# Debug and release optimization options. Can be overwritten in Makefile.config.$(PLATFORM)
DEBUG_O_CFLAGS ?= -g -ggdb -O0
DEBUG_O_LFLAGS ?= -g
RELEASE_O_CFLAGS ?= -g -O2
RELEASE_O_LFLAGS ?= -g