From b070fb2cd27cfbcbfa57dda005d27733aab51a59 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Wed, 30 Dec 2015 11:26:02 +1100 Subject: [PATCH] Makefile: Allow EXTRA_CFLAGS, EXTRA_CXXFLAGS, overriding of CXXFLAGS, etc. --- common.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common.mk b/common.mk index f164689..c18a650 100644 --- a/common.mk +++ b/common.mk @@ -100,11 +100,11 @@ ENTRY_SYMBOL ?= call_user_start SPLIT_SECTIONS ?= 1 # Common flags for both C & C++_ -C_CXX_FLAGS = -Wall -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals $(CPPFLAGS) +C_CXX_FLAGS ?= -Wall -Werror -Wl,-EL -nostdlib -mlongcalls -mtext-section-literals $(CPPFLAGS) $(EXTRA_C_CXX_FLAGS) # Flags for C only -CFLAGS = $(C_CXX_FLAGS) -std=gnu99 +CFLAGS ?= $(C_CXX_FLAGS) -std=gnu99 $(EXTRA_CFLAGS) # Flags for C++ only -CXXFLAGS = $(C_CXX_FLAGS) -fno-exceptions -fno-rtti +CXXFLAGS ?= $(C_CXX_FLAGS) -fno-exceptions -fno-rtti $(EXTRA_CXXFLAGS) LDFLAGS = -nostdlib -Wl,--no-check-sections -L$(BUILD_DIR)sdklib -L$(ROOT)lib -u $(ENTRY_SYMBOL) -Wl,-static -Wl,-Map=build/${PROGRAM}.map $(EXTRA_LDFLAGS)