88411067830d21b2ba720c1ea48016d223ec8637
[goodfet] / firmware / Makefile
1
2 #include `uname`.mak
3 GOODFET?=/dev/ttyUSB0
4
5
6 #For tos-bsl, use --invert-reset --invert-test
7 BSL?=goodfet.bsl -c $(GOODFET) --speed=38400
8
9
10 #One of these should be defined explicitly.
11 #Default removed because of confusion.
12
13 #mcu=msp430x2274
14 #mcu=msp430x2618
15 #mcu?=msp430x1612
16 mcu?=RUNCONFIG
17
18 #N.B., gcc WILL NOT BITCH if this file doesn't exist.
19 #GCCINC=-T ldscripts/161x.x
20 GCCINC=-T ldscripts/$(mcu).x
21
22 CCEXTRA?=
23 CC=msp430-gcc -Wall -Os -g -mmcu=$(mcu) -D$(mcu) -DGCC $(GCCINC) -I include $(CCEXTRA)
24
25 #Define extra modules here.
26 moreapps?=apps/i2c/i2c.o apps/chipcon/chipcon.o apps/glitch/glitch.o apps/jtag/sbw.o apps/smartcard/smartcard.o
27 # should include apps/jtag/jtagarm7tdmi.o to build jtag for ARM7
28
29 apps= $(moreapps) apps/monitor/monitor.o apps/spi/spi.o   apps/jtag/jtag.o apps/jtag/jtag430.o apps/jtag/jtag430x2.o apps/avr/avr.o apps/jtag/ejtag.o apps/jtag/jtagxscale.o
30
31 #apps/chipcon/chipconasm.o removed
32 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o 
33
34 app= goodfet
35
36 all: $(app).hex
37
38 lib/.o:
39         ./configure
40         false
41 lib/RUNCONFIG.o:
42         ./configure
43         false
44
45 goodfet.hex: goodfet
46
47 run:
48         ../client/goodfet.msp430 test
49
50 install: $(app).hex
51         #$(BSL) -e
52         #ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
53         $(BSL) -e -p $(app).hex 
54 verify:
55         $(BSL) -P $(app).hex -v $(app).hex
56 dumpinfo:
57         $(BSL) --dumpinfo
58 $(app): $(app).c $(libs) $(apps)
59 $(app).hex: $(app)
60         msp430-objcopy goodfet -O ihex goodfet.hex
61 m4s: $(app).hex
62         msp430-objdump -D -m msp430 $(app).hex | m4s init
63 erase:
64         $(BSL) -e 
65 clean:
66         rm -f $(app) $(app).hex $(libs) $(apps)
67 docs:
68         doxygen
69 pushdocs: docs
70         rsync --exclude .svn -ave ssh doc/html/* travisutk,goodfet@web.sourceforge.net:htdocs/docs/
71 .FAKE: docs