summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--stmhal/Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index 64c58151b..116aeb114 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -42,20 +42,21 @@ INC += -I$(CC3K_DIR)
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
-
CFLAGS += -Iboards/$(BOARD)
-#Debugging/Optimization
+LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map) --cref
+LIBS =
+
+# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -g -DPENDSV_DEBUG
COPT = -O0
else
+CFLAGS += -fdata-sections -ffunction-sections
COPT += -Os -DNDEBUG
+LDFLAGS += --gc-sections
endif
-LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map) --cref
-LIBS =
-
# uncomment this if you want libgcc
#LIBS += $(shell $(CC) -print-libgcc-file-name)