1 # 2 # Common global compiler configuration 3 # 4 5 # Common Compiler Flags ######################################################## 6 7 # CHRE requires C++11 and C99 support. 8 COMMON_CXX_CFLAGS += -std=c++11 9 COMMON_C_CFLAGS += -x c 10 COMMON_C_CFLAGS += -std=c99 11 12 # Configure 'all' and 'extra' warnings and promote warnings to errors. 13 COMMON_CFLAGS += -Wall 14 COMMON_CFLAGS += -Wextra 15 COMMON_CFLAGS += -Werror 16 17 # Disabled warnings. You better have a good reason to add more here. 18 COMMON_CFLAGS += -Wno-unused-parameter 19 20 # Additional warnings. Even more! :] 21 COMMON_CFLAGS += -Wshadow 22 23 # Disable exceptions and RTTI. 24 COMMON_CFLAGS += -fno-exceptions 25 COMMON_CFLAGS += -fno-rtti 26 27 # Enable the linker to garbage collect unused code and variables. 28 COMMON_CFLAGS += -fdata-sections 29 COMMON_CFLAGS += -ffunction-sections 30 31 # Enable debugging symbols for debug builds. 32 COMMON_DEBUG_CFLAGS += -g 33 34 # Dependency Resolution 35 DEP_CFLAGS = -MM -MG -MP -MF $$(basename $$@).Td 36 DEP_POST_COMPILE = @mv -f $$(basename $$@).Td $$(basename $$@).d && touch $$@ 37 38 # Compile with hidden visibility by default. 39 COMMON_CFLAGS += -fvisibility=hidden 40 41 # Common Archive Flags ######################################################### 42 43 COMMON_ARFLAGS += rsc 44