Getting closer to an I2C Python client.
[goodfet] / firmware / Makefile
index b17708b..3e8271d 100644 (file)
@@ -1,17 +1,22 @@
 
-PORT=/dev/ttyUSB0
-BSL=msp430-bsl --invert-reset --invert-test -c $(PORT) --speed=38400
+#include `uname`.mak
 
-#mcu=msp430x1611
-mcu=msp430x1612
+GOODFET?=/dev/ttyUSB0
+BSL=../../contrib/tos-bsl --invert-reset --invert-test -c $(GOODFET) --speed=38400
 
-#ldscript is wonky
-GCCINC=-T ldscripts/161x.x
+#mcu=msp430x2274
+#mcu=msp430x2618
+mcu?=msp430x1612
+
+
+#N.B., gcc WILL NOT BITCH if this file doesn't exist.
+#GCCINC=-T ldscripts/161x.x
+GCCINC=-T ldscripts/$(mcu).x
 
 CC=msp430-gcc -Wall -g -mmcu=$(mcu) -DGCC $(GCCINC) -I include
 
 apps= apps/monitor/monitor.o apps/spi/spi.o apps/i2c/i2c.o apps/chipcon/chipcon.o apps/jtag/jtag.o apps/jtag/jtag430.o
-libs= lib/msp430f1612.o lib/command.o apps/jtag/jtag430asm.o
+libs= lib/$(mcu).o lib/command.o apps/jtag/jtag430asm.o
 app=goodfet
 
 all: $(app).hex
@@ -22,8 +27,13 @@ run:
        ../client/goodfet.msp430 test
 
 install: $(app).hex
-       $(BSL) -e -p $(app).hex 
-       #$(BSL) -P $(app).hex -r
+       $(BSL) -e
+       #$(BSL) -p info.txt || true  #MSP430F2xx targets only, inelegant.
+       $(BSL) -p $(app).hex 
+verify:
+       $(BSL) -P $(app).hex -v $(app).hex
+dumpinfo:
+       $(BSL) --dumpinfo -c /dev/ttyUSB0
 $(app): $(app).c $(libs) $(apps)
 $(app).hex: $(app)
        msp430-objcopy goodfet -O ihex goodfet.hex