1 # makfile configuration
3 OBJECTS = main.o swuart.o fll.o
6 ASFLAGS = -mmcu=${CPU} -mforce-hwmul -x assembler-with-cpp -D_GNU_ASSEMBLER_ -c
7 CFLAGS = -mmcu=${CPU} -mforce-hwmul -O2 -Wall -g
9 #switch the compiler (for the internal make rules)
13 .PHONY: all FORCE clean download download-jtag download-bsl dist
15 #all should be the first target. it's built when make is runwithout args
16 all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst
18 #confgigure the next line if you want to use the serial download
19 download: download-uart
20 #download: download-jtag
21 #download: download-bsl
23 #additional rules for files
24 ${NAME}.elf: ${OBJECTS}
25 ${CC} -mmcu=${CPU} -o $@ ${OBJECTS}
27 ${NAME}.a43: ${NAME}.elf
28 msp430-objcopy -O ihex $^ $@
30 ${NAME}.lst: ${NAME}.elf
31 msp430-objdump -dSt $^ > $@
34 msp430-jtag -e ${NAME}.elf
37 msp430-bsl -e ${NAME}.elf
40 openmsp430-loader.tcl -device /dev/ttyUSB0 -baudrate 115200 ${NAME}.elf
43 rm -f ${NAME} ${NAME}.a43 ${NAME}.lst *.o
47 tar czf dist.tgz *.c *.h *.txt makefile
49 #dummy target as dependecy if something has to be build everytime
53 main.o: main.c hardware.h
54 fll.o: fll.s hardware.h
55 swuart.o: swuart.s hardware.h