2009-02-21 00:16:08 +01:00
|
|
|
# $Id: Makefile.msp430,v 1.27 2009/02/20 23:16:08 nvt-se Exp $
|
2006-06-18 00:41:10 +02:00
|
|
|
|
2006-10-09 11:15:48 +02:00
|
|
|
ifdef nodeid
|
|
|
|
CFLAGS += -DNODEID=$(nodeid)
|
|
|
|
endif
|
|
|
|
|
2006-06-18 00:41:10 +02:00
|
|
|
.SUFFIXES:
|
|
|
|
|
|
|
|
### Define the CPU directory
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/msp430
|
|
|
|
|
|
|
|
### Define the source files we have in the MSP430 port
|
|
|
|
|
2007-05-13 10:41:11 +02:00
|
|
|
CONTIKI_CPU_DIRS = . dev
|
|
|
|
|
2006-12-19 10:22:25 +01:00
|
|
|
MSP430 = msp430.c flash.c clock.c leds.c leds-arch.c \
|
2008-02-03 21:59:35 +01:00
|
|
|
watchdog.c lpm.c mtarch.c uart1.c slip_uart1.c rtimer-arch.c
|
2006-06-18 00:41:10 +02:00
|
|
|
UIPDRIVERS = me.c me_tabs.c slip.c crc16.c
|
2006-12-18 16:17:47 +01:00
|
|
|
ELFLOADER = elfloader.c elfloader-msp430.c symtab.c
|
2006-06-18 00:41:10 +02:00
|
|
|
TARGETLIBS = random.c serial.c
|
|
|
|
|
|
|
|
CONTIKI_TARGET_SOURCEFILES += $(MSP430) \
|
|
|
|
$(SYSAPPS) $(ELFLOADER) \
|
|
|
|
$(TARGETLIBS) $(UIPDRIVERS)
|
|
|
|
|
|
|
|
CONTIKI_SOURCEFILES += $(CONTIKI_TARGET_SOURCEFILES)
|
|
|
|
|
|
|
|
|
|
|
|
### Compiler definitions
|
|
|
|
CC = msp430-gcc
|
2007-01-24 17:11:48 +01:00
|
|
|
LD = msp430-gcc
|
2006-06-18 00:41:10 +02:00
|
|
|
AS = msp430-as
|
|
|
|
AR = msp430-ar
|
2007-03-23 00:57:33 +01:00
|
|
|
NM = msp430-nm
|
2006-06-18 00:41:10 +02:00
|
|
|
OBJCOPY = msp430-objcopy
|
|
|
|
STRIP = msp430-strip
|
|
|
|
BSL = msp430-bsl
|
2008-01-08 09:01:01 +01:00
|
|
|
ifdef WERROR
|
|
|
|
CFLAGSWERROR=-Werror
|
|
|
|
endif
|
|
|
|
CFLAGSNO = -Wall -mmcu=$(MCU) -g $(CFLAGSWERROR)
|
2006-06-18 00:41:10 +02:00
|
|
|
CFLAGS += $(CFLAGSNO) -Os
|
2006-06-22 16:24:49 +02:00
|
|
|
LDFLAGS += -mmcu=$(MCU) -Wl,-Map=contiki-$(TARGET).map
|
2006-06-18 00:41:10 +02:00
|
|
|
|
|
|
|
PROJECT_OBJECTFILES += ${addprefix $(OBJECTDIR)/,$(CONTIKI_TARGET_MAIN:.c=.o)}
|
|
|
|
|
|
|
|
### Compilation rules
|
|
|
|
|
|
|
|
%-stripped.o: %.c
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
$(STRIP) --strip-unneeded -g -x $@
|
|
|
|
|
|
|
|
%.cm: %.co
|
|
|
|
$(LD) -i -r --unresolved-symbols=ignore-in-object-files -mmsp430x149 -o $@ $^
|
|
|
|
$(STRIP) --strip-unneeded -g -x $@
|
|
|
|
|
|
|
|
%-stripped.o: %.o
|
|
|
|
$(STRIP) --strip-unneeded -g -x -o $@ $<
|
|
|
|
|
|
|
|
%.o: ${CONTIKI_TARGET}/loader/%.S
|
|
|
|
$(AS) -o $(notdir $(<:.S=.o)) $<
|
|
|
|
|
2008-12-16 14:54:25 +01:00
|
|
|
%.firmware: %.${TARGET}
|
|
|
|
mv $< $@
|
2006-06-18 00:41:10 +02:00
|
|
|
|
2008-07-02 16:11:34 +02:00
|
|
|
%.ihex: %.$(TARGET)
|
2006-06-18 00:41:10 +02:00
|
|
|
$(OBJCOPY) $^ -O ihex $@
|
|
|
|
|
2008-12-16 14:54:25 +01:00
|
|
|
%.mspsim: %.${TARGET}
|
2008-11-24 12:09:36 +01:00
|
|
|
java -jar ${CONTIKI}/tools/mspsim/mspsim.jar -platform=${TARGET} $<
|
|
|
|
|
2008-12-16 14:54:25 +01:00
|
|
|
core-labels.o: core.${TARGET}
|
|
|
|
${CONTIKI}/tools/msp430-make-labels core.${TARGET} > core-labels.S
|
2006-06-18 00:41:10 +02:00
|
|
|
$(AS) -o $@ core-labels.S
|
|
|
|
# cp core-labels.o app/
|
|
|
|
|
2008-12-16 14:54:25 +01:00
|
|
|
core-globals.o: core.${TARGET}
|
|
|
|
${CONTIKI}/tools/msp430-make-globals core.${TARGET} > core-globals.S
|
2006-06-18 00:41:10 +02:00
|
|
|
$(AS) -o $@ core-globals.S
|
|
|
|
|
|
|
|
loader-init.o: ${CONTIKI_TARGET}/loader/loader-init.S
|
|
|
|
$(AS) -o $(notdir $(<:.S=.o)) $<
|
|
|
|
# cp loader-init.o build-app/
|
|
|
|
|
2006-12-19 10:22:25 +01:00
|
|
|
.PHONY: symbols.c symbols.h
|
|
|
|
ifdef CORE
|
2007-01-24 17:11:48 +01:00
|
|
|
symbols.c:
|
|
|
|
# @${CONTIKI}/tools/msp430-make-symbols $(CORE)
|
|
|
|
$(NM) $(CORE) | awk -f ../../tools/mknmlist > symbols.c
|
2006-12-19 10:22:25 +01:00
|
|
|
else
|
|
|
|
symbols.c symbols.h:
|
|
|
|
@${CONTIKI}/tools/make-empty-symbols
|
|
|
|
endif
|