aboutsummaryrefslogtreecommitdiff
path: root/examples/Makefile.include
diff options
context:
space:
mode:
authorPiotr Esden-Tempski2010-12-27 21:30:12 +0100
committerPiotr Esden-Tempski2010-12-27 21:30:12 +0100
commit600d8c345818be7493753bcee79f3e47e1c3f389 (patch)
tree87f291fe784ae04499d9e73297911855653bc3b1 /examples/Makefile.include
parent81045ff27911481f886cc014b63bae2a8566820c (diff)
Added gc-sections. Now unused functions are being garbage collected.
Diffstat (limited to 'examples/Makefile.include')
-rw-r--r--examples/Makefile.include10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/Makefile.include b/examples/Makefile.include
index 85c6638..bd978fe 100644
--- a/examples/Makefile.include
+++ b/examples/Makefile.include
@@ -26,11 +26,11 @@ OBJDUMP = $(PREFIX)-objdump
# Uncomment this line if you want to use the installed (not local) library.
# TOOLCHAIN_DIR = `dirname \`which $(CC)\``/../$(PREFIX)
TOOLCHAIN_DIR = ../../..
-CFLAGS = -O0 -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
- -mcpu=cortex-m3 -mthumb
+CFLAGS += -Os -g -Wall -Wextra -I$(TOOLCHAIN_DIR)/include -fno-common \
+ -mcpu=cortex-m3 -mthumb
LDSCRIPT = $(BINARY).ld
-LDFLAGS = -L$(TOOLCHAIN_DIR)/lib -T$(LDSCRIPT) -nostartfiles
-#LDFLAGS = -T$(LDSCRIPT) -nostartfiles
+LDFLAGS += -L$(TOOLCHAIN_DIR)/lib -T$(LDSCRIPT) -nostartfiles \
+ -Wl,--gc-sections
OBJS += $(BINARY).o
OOCD ?= openocd
@@ -41,6 +41,8 @@ OOCD_BOARD ?= olimex_stm32_h103
ifneq ($(V),1)
Q := @
NULL := 2>/dev/null
+else
+LDFLAGS += -Wl,--print-gc-sections
endif
.SUFFIXES: .elf .bin .hex .srec .list .images