-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·69 lines (53 loc) · 1.15 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
ifndef SERIAL
export SERIAL=/dev/ttyACM0
endif
erasedevice:
read a #press reset on the device, then immediately press enter
sudo st-flash erase
writebootloader:
read a #press enter to write bootloader.bin to the device
sudo st-flash write bootloader.bin 0x08000000
cleanbootloader: erasedevice writebootloader
docompile:
cat *.coffee | coffee -bsc > compiled.js
writecompiled:
cat ${SERIAL}
echo 'reset()' > ${SERIAL}
echo 'echo(0)' > ${SERIAL}
cat compiled.js > ${SERIAL}
echo 'echo(1)' > ${SERIAL}
writesave:
echo 'save()' > ${SERIAL}
cat ${SERIAL}
sleep 1
cat ${SERIAL}
cat ${SERIAL}
cat ${SERIAL}
sleep 1
cat ${SERIAL}
cat ${SERIAL}
cat ${SERIAL}
sleep 1
cat ${SERIAL}
cat ${SERIAL}
cat ${SERIAL}
clearserial:
cat ${SERIAL}
cat ${SERIAL}
cat ${SERIAL}
dowrite: writecompiled writesave
openserial:
miniterm.py ${SERIAL}
allnosave: clearserial checknotroot docompile writecompiled
all: clearserial checknotroot docompile dowrite
default: all
checknotroot:
ifeq (,$(wildcard bootloader))
else
Ran from root, stopped.
endif
ifeq (,$(wildcard bootloader.md))
else
Ran from bootloader folder, stopped.
endif
.DEFAULT_GOAL=default