goodwatch/firmware/Makefile

52 lines
1.3 KiB
Makefile
Raw Normal View History

2017-09-21 19:31:09 +00:00
#Standard Debian gcc-msp430 and msp430mcu packages.
2017-11-14 16:21:28 +00:00
CC = msp430-gcc -mmcu=cc430f6137 -Wall -I. -Os
2017-09-21 19:31:09 +00:00
2017-12-03 03:49:33 +00:00
BSL = ../bin/cc430-bsl.py -r 38400
2017-09-23 16:36:20 +00:00
modules=rtcasm.o main.o lcd.o lcdtext.o rtc.o keypad.o apps.o applist.o \
2017-12-09 12:34:21 +00:00
sidebutton.o power.o uart.o monitor.o ucs.o \
radio.o packet.o dmesg.o codeplug.o rng.o \
libs/assembler.o libs/morse.o
apps= apps/clock.o apps/rpn.o apps/hex.o apps/stopwatch.o apps/dice.o \
apps/tuner.o apps/morse.o apps/beacon.o apps/iclicker.o \
apps/submenu.o
all: goodwatch.hex
*.c: gittag.h
gittag.h:
echo "#define GITTAG" 0x`git describe --always` >gittag.h
goodwatch: $(modules) $(apps) *.h
$(CC) -T msp430.x -o goodwatch $(modules) $(apps)
../bin/printsizes.py goodwatch || echo "Please install python-pyelftools."
goodwatch.hex: goodwatch
msp430-objcopy -O ihex goodwatch goodwatch.hex
2017-09-21 19:31:09 +00:00
clean:
rm -rf *~ */*~ *.hex *.elf *.o */*.o goodwatch gittag.h html latex
2017-09-21 19:31:09 +00:00
erase:
2017-09-23 16:36:20 +00:00
$(BSL) -e
flash: goodwatch.hex
$(BSL) -etf goodwatch.hex
dmesg:
$(BSL) -P goodwatch.hex -uD
2017-09-23 16:36:20 +00:00
#Same as dmesg, but it gives the target some time to boot first.
run:
sleep 5
../bin/cc430-bsl.py -P goodwatch.hex -uD
2017-11-30 20:48:22 +00:00
codeplug.hex: codeplug.txt
../bin/goodwatch-txt2cp.py -i codeplug.txt -o codeplug.hex
flashcp: codeplug.hex
#FIXME Might need a different sort of erase.
2017-12-03 03:49:33 +00:00
$(BSL) -Ef codeplug.hex
dump:
$(BSL) -ed