diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-08-25 14:17:38 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-08-25 14:17:38 +0000 |
commit | 65baafa9e6e82293a202c96e832c7779b7216550 (patch) | |
tree | 5e8168a51d1d8f8e54deb9d2b9394f9955e18705 /demos/ARM7-AT91SAM7X-WEB-GCC/Makefile | |
parent | 01afd268a5f8bb48007b44e6c2aa7c0d3eafe757 (diff) | |
download | ChibiOS-65baafa9e6e82293a202c96e832c7779b7216550.tar.gz ChibiOS-65baafa9e6e82293a202c96e832c7779b7216550.tar.bz2 ChibiOS-65baafa9e6e82293a202c96e832c7779b7216550.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@404 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-AT91SAM7X-WEB-GCC/Makefile')
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/Makefile | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile index 77651350c..243d525f8 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile @@ -26,6 +26,9 @@ BIN = $(CP) -O binary MCU = arm7tdmi
+# Enable this if you want the linker to remove unused code and data
+LINK_GC = yes
+
# List all default C defines here, like -D_DEBUG=1
DDEFS =
@@ -127,6 +130,10 @@ WARN = -Wall -Wstrict-prototypes # End of user defines
##############################################################################################
+ifeq ($(LINK_GC),yes)
+ OPT += -ffunction-sections -fdata-sections
+endif
+
INCDIR = $(patsubst %,-I%,$(DINCDIR) $(UINCDIR))
LIBDIR = $(patsubst %,-L%,$(DLIBDIR) $(ULIBDIR))
DEFS = $(DDEFS) $(UDEFS)
@@ -138,10 +145,15 @@ ASMOBJS = $(ASMSRC:.s=.o) LIBS = $(DLIBS) $(ULIBS)
MCFLAGS = -mcpu=$(MCU)
+ODFLAGS = -x --syms
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(<:.s=.lst) $(ADEFS)
CPFLAGS = $(MCFLAGS) $(OPT) $(WARN) -Wa,-alms=$(<:.c=.lst) $(DEFS)
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
-ODFLAGS = -x --syms
+ifeq ($(LINK_GC),yes)
+ LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LIBDIR)
+else
+ LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(PROJECT).map,--cref,--no-warn-mismatch $(LIBDIR)
+endif
# Thumb interwork enabled only if needed because it kills performance.
ifneq ($(TSRC),)
|