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