ec5ac6e653604c678d1016168c3a89d68d33db25
[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 --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 # should include apps/pic/dspic33f.o to build support for PIC24H/dsPIC33F
29
30 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
31
32 #apps/chipcon/chipconasm.o removed
33 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o 
34
35 app= goodfet
36
37 all: $(app).hex
38
39 lib/.o:
40         ./configure
41         false
42 lib/RUNCONFIG.o:
43         ./configure
44         false
45
46 goodfet.hex: goodfet
47
48 run:
49         ../client/goodfet.msp430 test
50
51 install: $(app).hex
52         #$(BSL) -e
53         #ls info.txt && $(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
54         $(BSL) -e -p $(app).hex 
55 verify:
56         $(BSL) -P $(app).hex -v $(app).hex
57 dumpinfo:
58         $(BSL) --dumpinfo
59 $(app): $(app).c $(libs) $(apps)
60 $(app).hex: $(app)
61         msp430-objcopy goodfet -O ihex goodfet.hex
62 m4s: $(app).hex
63         msp430-objdump -D -m msp430 $(app).hex | m4s init
64 erase:
65         $(BSL) -e 
66 clean:
67         rm -f $(app) $(app).hex $(libs) $(apps)
68 docs:
69         doxygen
70 pushdocs: docs
71         rsync --exclude .svn -ave ssh doc/html/* travisutk,goodfet@web.sourceforge.net:htdocs/docs/
72 .FAKE: docs