-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
73 lines (53 loc) · 2.97 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
69
70
71
72
73
# aliases
.PHONY: clean arduino-colorlamp build-arduino-colorlamp flash-arduino-colorlamp microbit-blink build-microbit-blink flash-microbit-blink microbit-pixelbuttons build-microbit-pixelbuttons flash-microbit-pixelbuttons nrf-colorlamp build-nrf-colorlamp flash-nrf-colorlamp microbit-accel build-microbit-accel flash-microbit-accel reelboard-accel build-reelboard-accel flash-reelboard-accel
clean:
mkdir -p build
rm -rf build/**
build-arduino-colorlamp:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/arduino-colorlamp.hex -target arduino /src/arduino-colorlamp/main.go
flash-arduino-colorlamp:
avrdude -c arduino -p atmega328p -P /dev/ttyACM0 -U flash:w:build/arduino-colorlamp.hex
arduino-colorlamp:
make clean
make build-arduino-colorlamp
make flash-arduino-colorlamp
build-microbit-blink:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/microbit-blink.hex -target microbit /src/microbit-blink/main.go
flash-microbit-blink:
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program build/microbit-blink.hex reset exit'
microbit-blink:
make clean
make build-microbit-blink
make flash-microbit-blink
build-microbit-pixelbuttons:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/microbit-pixelbuttons.hex -target microbit /src/microbit-pixelbuttons/main.go
flash-microbit-pixelbuttons:
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program build/microbit-pixelbuttons.hex reset exit'
microbit-pixelbuttons:
make clean
make build-microbit-pixelbuttons
make flash-microbit-pixelbuttons
build-microbit-accel:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/microbit-accel.hex -target microbit /src/accel/main.go
flash-microbit-accel:
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program build/microbit-accel.hex reset exit'
microbit-accel:
make clean
make build-microbit-accel
make flash-microbit-accel
build-reelboard-accel:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/reelboard-accel.hex -target reelboard /src/accel/main.go
flash-reelboard-accel:
openocd -f interface/cmsis-dap.cfg -f target/nrf51.cfg -c 'program build/reelboard-accel.hex reset exit'
reelboard-accel:
make clean
make build-reelboard-accel
make flash-reelboard-accel
build-nrf-colorlamp:
docker run --rm -v "$(PWD):/src" -v "$(GOPATH):/gohost" -e "GOPATH=$(GOPATH):/gohost" tinygo/tinygo:0.7.1 tinygo build -o /src/build/nrf-colorlamp.hex -target pca10040 /src/nrf-colorlamp/main.go
flash-nrf-colorlamp:
nrfjprog -f nrf52 --sectorerase --program build/nrf-colorlamp.hex --reset
nrf-colorlamp:
make clean
make build-nrf-colorlamp
make flash-nrf-colorlamp