A set of compiler options that reduce the size of the final code size and RAM usage with ~10%. Courtesy of Simon Duquennoy.

This commit is contained in:
adamdunkels 2011-01-19 07:24:37 +00:00
parent 50aee97fc2
commit 6f076dbe1a

View File

@ -1,4 +1,4 @@
# $Id: Makefile.msp430,v 1.33 2010/08/24 16:23:20 joxe Exp $
# $Id: Makefile.msp430,v 1.34 2011/01/19 07:24:37 adamdunkels Exp $
ifdef nodeid
CFLAGS += -DNODEID=$(nodeid)
@ -24,7 +24,6 @@ CONTIKI_TARGET_SOURCEFILES += $(MSP430) \
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
### Compiler definitions
CC = msp430-gcc
LD = msp430-gcc
@ -41,6 +40,14 @@ CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
CFLAGS += $(CFLAGSNO) -Os
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
### These flags can reduce the code size and RAM usage with up to 10%
if SMALL
CFLAGS += -ffunction-sections
LDFLAGS += -Wl,--gc-sections,--undefined=_reset_vector__,--undefined=InterruptVectors,--undefined=_copy_data_init__,--undefined=_clear_bss_init__,--undefined=_end_of_init__
endif # SMALL
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
### Compilation rules