1 # $Id: Makefile.msp430,v 1.31 2009/11/19 17:33:05 nifi Exp $
4 CFLAGS += -DNODEID=$(nodeid)
9 ### Define the CPU directory
10 CONTIKI_CPU=$(CONTIKI)/cpu/msp430
12 ### Define the source files we have in the MSP430 port
14 CONTIKI_CPU_DIRS = . dev
16 MSP430 = msp430.c flash.c clock.c leds.c leds-arch.c \
17 watchdog.c lpm.c mtarch.c uart1.c slip_uart1.c uart1-putchar.c rtimer-arch.c
18 UIPDRIVERS = me.c me_tabs.c slip.c crc16.c
19 ELFLOADER = elfloader.c elfloader-msp430.c symtab.c
21 CONTIKI_TARGET_SOURCEFILES += $(MSP430) \
22 $(SYSAPPS) $(ELFLOADER) \
25 CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
28 ### Compiler definitions
34 OBJCOPY = msp430-objcopy
40 CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
41 CFLAGS += $(CFLAGSNO) -Os
42 LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
44 PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
49 $(CC) $(CFLAGS) -c $< -o $@
50 $(STRIP) --strip-unneeded -g -x $@
53 $(LD) -i -r --unresolved-symbols=ignore-in-object-files -mmsp430x149 -o $@ $^
54 $(STRIP) --strip-unneeded -g -x $@
57 $(STRIP) --strip-unneeded -g -x -o $@ $<
59 %.o: ${CONTIKI_TARGET}/loader/%.S
60 $(AS) -o $(notdir $(<:.S=.o)) $<
62 %.firmware: %.${TARGET}
66 $(OBJCOPY) $^ -O ihex $@
69 java -jar ${CONTIKI}/tools/mspsim/mspsim.jar -platform=${TARGET} $<
71 core-labels.o: core.${TARGET}
72 ${CONTIKI}/tools/msp430-make-labels core.${TARGET} > core-labels.S
73 $(AS) -o $@ core-labels.S
74 # cp core-labels.o app/
76 core-globals.o: core.${TARGET}
77 ${CONTIKI}/tools/msp430-make-globals core.${TARGET} > core-globals.S
78 $(AS) -o $@ core-globals.S
80 loader-init.o: ${CONTIKI_TARGET}/loader/loader-init.S
81 $(AS) -o $(notdir $(<:.S=.o)) $<
82 # cp loader-init.o build-app/
84 .PHONY: symbols.c symbols.h
87 # @${CONTIKI}/tools/msp430-make-symbols $(CORE)
88 $(NM) $(CORE) | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
91 @${CONTIKI}/tools/make-empty-symbols