2017-07-11 19:05:01 +00:00
|
|
|
SYSTEM_TYPE := $(shell gcc -dumpmachine)
|
2021-08-17 21:12:12 +00:00
|
|
|
GCC_VERSION := $(shell gcc --version 2>/dev/null)
|
2017-07-11 19:05:01 +00:00
|
|
|
|
2021-10-21 13:39:13 +00:00
|
|
|
CC = $(CC_PREFIX) gcc
|
2020-01-04 01:21:08 +00:00
|
|
|
OBJCOPY =
|
|
|
|
OBJDUMP =
|
|
|
|
SIZE =
|
|
|
|
AR =
|
|
|
|
NM =
|
|
|
|
HEX =
|
|
|
|
EEP =
|
2016-08-22 06:16:08 +00:00
|
|
|
BIN =
|
|
|
|
|
|
|
|
|
|
|
|
COMPILEFLAGS += -funsigned-char
|
2021-08-17 21:12:12 +00:00
|
|
|
ifeq ($(findstring clang, ${GCC_VERSION}),)
|
2016-08-22 06:16:08 +00:00
|
|
|
COMPILEFLAGS += -funsigned-bitfields
|
2021-08-17 21:12:12 +00:00
|
|
|
endif
|
2016-08-22 06:16:08 +00:00
|
|
|
COMPILEFLAGS += -ffunction-sections
|
|
|
|
COMPILEFLAGS += -fdata-sections
|
|
|
|
COMPILEFLAGS += -fshort-enums
|
2017-07-11 19:05:01 +00:00
|
|
|
ifneq ($(findstring mingw, ${SYSTEM_TYPE}),)
|
|
|
|
COMPILEFLAGS += -mno-ms-bitfields
|
|
|
|
endif
|
2016-08-22 06:16:08 +00:00
|
|
|
|
|
|
|
CFLAGS += $(COMPILEFLAGS)
|
2021-08-17 21:12:12 +00:00
|
|
|
ifeq ($(findstring clang, ${GCC_VERSION}),)
|
2016-08-22 06:16:08 +00:00
|
|
|
CFLAGS += -fno-inline-small-functions
|
2021-08-17 21:12:12 +00:00
|
|
|
endif
|
2016-08-22 06:16:08 +00:00
|
|
|
CFLAGS += -fno-strict-aliasing
|
|
|
|
|
2020-01-04 01:21:08 +00:00
|
|
|
CXXFLAGS += $(COMPILEFLAGS)
|
|
|
|
CXXFLAGS += -fno-exceptions
|
2022-06-05 22:47:22 +00:00
|
|
|
CXXFLAGS += $(CXXSTANDARD)
|