blob: ccdcf327bae31e51518e1561f5d37e1ac4315d68 [file] [log] [blame]
EXTRA_CFLAGS += -Wall -Werror
ARFLAGS = r
BLD_CC_HOST = $(CCACHE) gcc
BLD_CC = $(CCACHE) $(CROSS_COMPILE)gcc
BLD_AS = $(CCACHE) $(CROSS_COMPILE)gcc
BLD_AR = $(CROSS_COMPILE)ar
BLD_DEP = $(BLD_CC)
# Maple SDK requires C99
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
LD_ARCH_FLAGS += -m elf_i386 --oformat=elf32-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
CONFIGURE_TARGET ?= i586-linux-gnu
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 -gdwarf-3 -O0
DEBUG_O_LFLAGS ?= -g
RELEASE_O_CFLAGS ?= -g -gdwarf-3 -O0
RELEASE_O_LFLAGS ?= -g