Block reads in CC_READ_XDATA_MEMORY.
[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 # should include apps/adc/adc.o to build support for ADC10 app (still specific to x2274, GoodFET31).
37
38 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 
39
40 #apps/chipcon/chipconasm.o removed
41 libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o  lib/dco_calib.o
42
43 app= goodfet
44
45 all: $(app).hex
46
47 lib/.o: config
48         ./configure
49         false
50 lib/RUNCONFIG.o:
51         ./configure
52         false
53 config:
54         cp platforms/$(platform).h include/config.h
55 goodfet.hex: goodfet
56
57 run:
58         ../client/goodfet.msp430 test
59
60 install: $(app).hex
61         $(BSL) -e -p $(app).hex 
62         ls info.txt && $(BSL) -P $(app).hex -p info.txt || true  #MSP430F2xx targets only, inelegant.
63 verify:
64         $(BSL) -P $(app).hex -v $(app).hex
65 dumpinfo:
66         $(BSL) --dumpinfo
67 $(app).c: config
68 $(app): $(app).c $(libs) $(apps)
69 $(app).hex: $(app)
70         msp430-objcopy goodfet -O ihex goodfet.hex
71 m4s: $(app).hex
72         msp430-objdump -D -m msp430 $(app).hex | m4s init
73 erase:
74         $(BSL) -e 
75 clean:
76         rm -f $(app) $(app).hex $(libs) $(apps) include/config.h
77 docs:
78         doxygen
79 pushdocs: docs
80         rsync --exclude .svn -ave ssh doc/html/* travisutk,goodfet@web.sourceforge.net:htdocs/docs/
81 .FAKE: docs