2020-10-07 09:37:43 +00:00
|
|
|
# Compiller
|
|
|
|
ifeq ($(TOOLCHAIN), arm)
|
|
|
|
PREFIX = arm-none-eabi-
|
|
|
|
ifdef GCC_PATH
|
|
|
|
PREFIX = $(GCC_PATH)/$(PREFIX)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-05-12 07:59:20 +00:00
|
|
|
CC = $(PREFIX)gcc -std=gnu17
|
|
|
|
CPP = $(PREFIX)g++ -std=gnu++17
|
2020-11-14 16:24:38 +00:00
|
|
|
LD = $(PREFIX)g++
|
2020-10-07 09:37:43 +00:00
|
|
|
AS = $(PREFIX)gcc -x assembler-with-cpp
|
|
|
|
CP = $(PREFIX)objcopy
|
|
|
|
SZ = $(PREFIX)size
|
|
|
|
HEX = $(CP) -O ihex
|
|
|
|
BIN = $(CP) -O binary -S
|
|
|
|
|
|
|
|
DEBUG ?= 1
|
2021-05-12 07:59:20 +00:00
|
|
|
COMPACT ?= 0
|
2020-10-07 09:37:43 +00:00
|
|
|
ifeq ($(DEBUG), 1)
|
2021-05-12 07:59:20 +00:00
|
|
|
CFLAGS += -DDEBUG -Og -g
|
|
|
|
else ifeq ($(COMPACT), 1)
|
|
|
|
CFLAGS += -DNDEBUG -DLFS_NO_ASSERT -Os
|
2020-10-07 09:37:43 +00:00
|
|
|
else
|
2021-05-12 07:59:20 +00:00
|
|
|
CFLAGS += -DNDEBUG -DLFS_NO_ASSERT -Og
|
2020-10-07 09:37:43 +00:00
|
|
|
endif
|
|
|
|
|
2021-05-12 07:59:20 +00:00
|
|
|
CFLAGS += -fdata-sections -ffunction-sections -fno-math-errno -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)"
|
|
|
|
CPPFLAGS += -fno-threadsafe-statics -fno-use-cxa-atexit -fno-exceptions -fno-rtti
|
|
|
|
LDFLAGS += -Wl,-Map=$(OBJ_DIR)/$(PROJECT).map,--cref -Wl,--gc-sections -Wl,--undefined=uxTopUsedPriority -u _printf_float
|