platform.mk (703B)
1 SYSTEM_TYPE := $(shell gcc -dumpmachine) 2 GCC_VERSION := $(shell gcc --version 2>/dev/null) 3 4 CC = $(CC_PREFIX) gcc 5 OBJCOPY = 6 OBJDUMP = 7 SIZE = 8 AR = 9 NM = 10 HEX = 11 EEP = 12 BIN = 13 14 15 COMPILEFLAGS += -funsigned-char 16 ifeq ($(findstring clang, ${GCC_VERSION}),) 17 COMPILEFLAGS += -funsigned-bitfields 18 endif 19 COMPILEFLAGS += -ffunction-sections 20 COMPILEFLAGS += -fdata-sections 21 COMPILEFLAGS += -fshort-enums 22 ifneq ($(findstring mingw, ${SYSTEM_TYPE}),) 23 COMPILEFLAGS += -mno-ms-bitfields 24 endif 25 26 CFLAGS += $(COMPILEFLAGS) 27 ifeq ($(findstring clang, ${GCC_VERSION}),) 28 CFLAGS += -fno-inline-small-functions 29 endif 30 CFLAGS += -fno-strict-aliasing 31 32 CXXFLAGS += $(COMPILEFLAGS) 33 CXXFLAGS += -fno-exceptions 34 CXXFLAGS += $(CXXSTANDARD)