mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
92 lines
2.8 KiB
Makefile
92 lines
2.8 KiB
Makefile
|
# $Id: Makefile.z1,v 1.4 2010/11/07 08:40:24 enricmcalvo Exp $
|
||
|
# msp430flasher -n msp430x5437 -w "Firmware.txt" -v -z [VCC]
|
||
|
|
||
|
ifndef IAR
|
||
|
GCC=1
|
||
|
endif
|
||
|
|
||
|
ifdef GCC
|
||
|
CFLAGS+=-Os -g
|
||
|
else
|
||
|
IAR=1
|
||
|
endif
|
||
|
|
||
|
ifdef IAR
|
||
|
CFLAGS+=-e --vla -Ohz --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40 --core=430X --data_model small --double=32 -D__MSP430F5438A__
|
||
|
CFLAGS += --diag_suppress=Pa050
|
||
|
#CFLAGS+=--no_cse --no_unroll --no_inline --no_code_motion --no_tbaa --debug -D__MSP430F5438A__ -e --double=32 --dlib_config 'C:\Program Files (x86)\IAR Systems\Embedded Workbench 6.0 Evaluation\430\LIB\DLIB\dl430xsfn.h' --core=430X --data_model=small -Ol --multiplier=32 --multiplier_location=4C0 --hw_workaround=CPU40
|
||
|
endif
|
||
|
|
||
|
CLEAN += *.exp5438 symbols.c symbols.h
|
||
|
|
||
|
ARCH=msp430.c leds.c watchdog.c \
|
||
|
spix.c cc2420.c cc2420-arch.c \
|
||
|
rtimer-arch.c node-id.c leds-arch.c uart1x.c lcd.c \
|
||
|
hal_lcd.c hal_lcd_fonts.c duty-cycle-scroller.c cfs-ram.c
|
||
|
|
||
|
ifeq ($(WITH_SLIP),1)
|
||
|
ARCH += slip_uart0.c
|
||
|
else
|
||
|
ARCH += uart1-putchar.c
|
||
|
endif
|
||
|
|
||
|
ifdef NODEID
|
||
|
CFLAGS+=-DNODEID=$(NODEID)
|
||
|
|
||
|
ifdef BURN_NODEID
|
||
|
CFLAGS+=-DBURN_NODEID
|
||
|
endif # BURN_NODEID
|
||
|
endif # NODEID
|
||
|
|
||
|
help:
|
||
|
@echo A few useful make commands:
|
||
|
@echo make help - shows this help
|
||
|
@echo make TARGET=exp5438 savetarget - stores selection of target to avoid using TARGET= on every make invokation
|
||
|
@echo make program.upload - compiles and uploads program to connected board
|
||
|
@echo make program.upload GCC=1 - uses the mspgcc compiler instead of IAR
|
||
|
@echo make program.upload NODEID=x - uploads with node_id set to x
|
||
|
|
||
|
CONTIKI_TARGET_DIRS = . dev apps net
|
||
|
ifndef CONTIKI_TARGET_MAIN
|
||
|
CONTIKI_TARGET_MAIN = contiki-exp5438-main.c
|
||
|
endif
|
||
|
|
||
|
ifdef UIP_CONF_IPV6
|
||
|
CFLAGS += -DWITH_UIP6=1
|
||
|
endif
|
||
|
|
||
|
CONTIKI_TARGET_SOURCEFILES += $(ARCH) $(UIPDRIVERS)
|
||
|
|
||
|
ifdef IAR
|
||
|
MCU=msp430x5438a
|
||
|
else
|
||
|
MCU=msp430x5438
|
||
|
endif
|
||
|
include $(CONTIKI)/cpu/msp430/Makefile.msp430
|
||
|
|
||
|
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|
||
|
# $(AR) rcf $@ $^
|
||
|
|
||
|
|
||
|
ifdef IAR
|
||
|
STACKSIZE=300
|
||
|
LDFLAGS_ELF=-B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -Felf -yn -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE)
|
||
|
|
||
|
LDFLAGS_HEX=-B -xm "$(IAR_PATH)/lib/dlib/dl430xsfn.r43" -f "$(IAR_PATH)/config/lnk430f5437.xcl" -l contiki-$(TARGET).map -Fintel-extended -s __program_start -D_STACK_SIZE=$(STACKSIZE) -D_DATA16_HEAP_SIZE=$(STACKSIZE) -D_DATA20_HEAP_SIZE=$(STACKSIZE)
|
||
|
|
||
|
LDFLAGS+=$(LDFLAGS_ELF)
|
||
|
|
||
|
%.hex: %.co $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) contiki-$(TARGET).a
|
||
|
$(LD) $(LDFLAGS_HEX) $(TARGET_STARTFILES) ${filter-out %.a,$^} ${filter %.a,$^} $(TARGET_LIBFILES) -o $@
|
||
|
|
||
|
else
|
||
|
%.hex: %.ihex
|
||
|
mv $< $@
|
||
|
endif
|
||
|
|
||
|
%.upload: %.hex
|
||
|
msp430flasher -n msp430x5438a -e ERASE_MAIN -w $< -v -z [VCC]
|
||
|
|
||
|
%.upload-clean: %.hex
|
||
|
msp430flasher -n msp430x5438a -w $< -v -z [VCC]
|