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