aboutsummaryrefslogtreecommitdiff
path: root/stmhal/Makefile
diff options
context:
space:
mode:
authorDave Hylands2015-11-25 09:24:36 -0800
committerDamien George2015-11-26 00:04:34 +0000
commit364bb61df339c5012fb2d5c4f05af4c57347aa09 (patch)
tree2d9551cc2a5d163b3688582a0ebcd05311ec4d56 /stmhal/Makefile
parent8844d031e4bc39cb6e6cd053b63a8cdaeb383221 (diff)
stmhal: Allow make DEBUG=1 to build
Diffstat (limited to 'stmhal/Makefile')
-rw-r--r--stmhal/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/stmhal/Makefile b/stmhal/Makefile
index 1e8af3987..8ee3f458f 100644
--- a/stmhal/Makefile
+++ b/stmhal/Makefile
@@ -58,14 +58,16 @@ CFLAGS += -DSTM32_HAL_H='<stm32$(MCU_SERIES)xx_hal.h>'
LDFLAGS = -nostdlib -T $(LD_FILE) -Map=$(@:.elf=.map) --cref
LIBS =
+# Remove uncalled code from the final image.
+CFLAGS += -fdata-sections -ffunction-sections
+LDFLAGS += --gc-sections
+
# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -g -DPENDSV_DEBUG
COPT = -O0
else
-CFLAGS += -fdata-sections -ffunction-sections
COPT += -Os -DNDEBUG
-LDFLAGS += --gc-sections
endif
# uncomment this if you want libgcc