|
@@ -6,8 +6,10 @@ 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 semihosting
|
|
|
+USE_SEMIHOST=--specs=rdimon.specs
|
|
|
+
|
|
|
+# Use retarget
|
|
|
# USE_SEMIHOST=--specs=nosys.specs
|
|
|
|
|
|
# Compiler & Linker
|
|
@@ -38,8 +40,10 @@ ARCH_FLAGS=-mthumb -mcpu=cortex-m$(CORTEX_M)
|
|
|
CFLAGS=$(ARCH_FLAGS) $(INCLUDES) -g -flto -ffunction-sections -fdata-sections
|
|
|
|
|
|
# Link for code size and create a map file
|
|
|
-LFLAGS=$(USE_NANO) $(USE_SEMIHOST) -nostartfiles -Wl,--gc-sections,-Map=$(PROJECT).map
|
|
|
-# LFLAGS=$(USE_NANO) $(USE_SEMIHOST) -Wl,--gc-sections,-Map=$(PROJECT).map
|
|
|
+# If not using semihosting/retarget:
|
|
|
+# LFLAGS=$(USE_NANO) $(USE_SEMIHOST) -nostartfiles -Wl,--gc-sections,-Map=$(PROJECT).map
|
|
|
+# Else:
|
|
|
+LFLAGS=$(USE_NANO) $(USE_SEMIHOST) -Wl,--gc-sections,-Map=$(PROJECT).map
|
|
|
|
|
|
all: $(PROJECT).bin $(PROJECT).dis $(PROJECT).axf
|
|
|
|