Partial refactoring, forgot spi.h early.
[goodfet] / firmware / Makefile
1
2 #include `uname`.mak
3
4 GOODFET?=/dev/ttyUSB0
5 BSL=../../contrib/tos-bsl --invert-reset --invert-test -c $(GOODFET) --speed=38400
6
7 #mcu=msp430x2274
8 #mcu=msp430x2618
9 mcu?=msp430x1612
10
11
12 #N.B., gcc WILL NOT BITCH if this file doesn't exist.
13 #GCCINC=-T ldscripts/161x.x
14 GCCINC=-T ldscripts/$(mcu).x
15
16 CCEXTRA?=
17 CC=msp430-gcc -Wall -g -mmcu=$(mcu) -DGCC $(GCCINC) -I include $(CCEXTRA)
18
19 #Define extra modules here.
20 moreapps?=
21
22 apps= $(moreapps) apps/monitor/monitor.o apps/spi/spi.o apps/i2c/i2c.o apps/chipcon/chipcon.o apps/jtag/jtag.o apps/jtag/jtag430.o apps/jtag/jtag430x2.o
23 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o
24 app= goodfet
25
26 all: $(app).hex
27
28 goodfet.hex: goodfet
29
30 run:
31         ../client/goodfet.msp430 test
32
33 install: $(app).hex
34         $(BSL) -e
35         ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
36         $(BSL) -p $(app).hex 
37 verify:
38         $(BSL) -P $(app).hex -v $(app).hex
39 dumpinfo:
40         $(BSL) --dumpinfo
41 $(app): $(app).c $(libs) $(apps)
42 $(app).hex: $(app)
43         msp430-objcopy goodfet -O ihex goodfet.hex
44 m4s: $(app).hex
45         msp430-objdump -D -m msp430 $(app).hex | m4s init
46 erase:
47         $(BSL) -e 
48 clean:
49         rm -f $(app) $(app).hex $(libs) $(apps)