mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-12 14:12:27 +00:00
653295df6f
* Core: newlib-nano heap management functions replaced with freertos functions * Core: replace newlib heap management functions for firmware only, not for bootloader * Core, Linker: automatically determine available heap size at linking. Co-authored-by: あく <alleteam@gmail.com>
30 lines
No EOL
819 B
Makefile
30 lines
No EOL
819 B
Makefile
# Compiller
|
|
ifeq ($(TOOLCHAIN), arm)
|
|
PREFIX = arm-none-eabi-
|
|
ifdef GCC_PATH
|
|
PREFIX = $(GCC_PATH)/$(PREFIX)
|
|
endif
|
|
endif
|
|
|
|
CC = $(PREFIX)gcc -std=gnu17
|
|
CPP = $(PREFIX)g++ -std=gnu++17
|
|
LD = $(PREFIX)g++
|
|
AS = $(PREFIX)gcc -x assembler-with-cpp
|
|
CP = $(PREFIX)objcopy
|
|
SZ = $(PREFIX)size
|
|
HEX = $(CP) -O ihex
|
|
BIN = $(CP) -O binary -S
|
|
|
|
DEBUG ?= 1
|
|
COMPACT ?= 0
|
|
ifeq ($(DEBUG), 1)
|
|
CFLAGS += -DDEBUG -Og -g
|
|
else ifeq ($(COMPACT), 1)
|
|
CFLAGS += -DNDEBUG -DLFS_NO_ASSERT -Os
|
|
else
|
|
CFLAGS += -DNDEBUG -DLFS_NO_ASSERT -Og
|
|
endif
|
|
|
|
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
|