41 lines
861 B
Plaintext
41 lines
861 B
Plaintext
# Selecting Core
|
|
CORTEX_M=4
|
|
|
|
# Use newlib-nano. To disable it, specify USE_NANO=
|
|
USE_NANO=--specs=nano.specs
|
|
|
|
# Use seimhosting or not
|
|
USE_SEMIHOST=--specs=rdimon.specs
|
|
USE_NOHOST=--specs=nosys.specs
|
|
|
|
CORE=CM$(CORTEX_M)
|
|
BASE=.
|
|
|
|
# Compiler & Linker
|
|
AS=arm-none-eabi-as
|
|
AR=arm-none-eabi-ar
|
|
CC=arm-none-eabi-gcc
|
|
CXX=arm-none-eabi-g++
|
|
OBJCOPY=arm-none-eabi-objcopy
|
|
OBJDUMP=arm-none-eabi-objdump
|
|
SIZE=arm-none-eabi-size
|
|
|
|
# Options for specific architecture
|
|
ARCH_FLAGS=-mthumb -mcpu=cortex-m$(CORTEX_M)
|
|
|
|
# Startup code
|
|
STARTUP=$(BASE)/startup/startup_ARM$(CORE).S
|
|
|
|
# -Os -flto -ffunction-sections -fdata-sections to compile for code size
|
|
CFLAGS=$(ARCH_FLAGS) $(STARTUP_DEFS) -Os -flto -ffunction-sections -fdata-sections
|
|
CXXFLAGS=$(CFLAGS)
|
|
|
|
# Generate debug information
|
|
DI=-Wa,-g
|
|
|
|
# Link for code size
|
|
GC=-Wl,--gc-sections
|
|
|
|
# Create map file
|
|
MAP=-Wl,-Map=$(NAME).map
|