-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
58 lines (37 loc) · 982 Bytes
/
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
.PHONY: all clean
APP ?= assemblyscript
all:
-@rm apps/$(APP)/app.wasm
cd apps/$(APP) && ./build.sh
-@rm ./src/wasm-app*
wasm2c --no-debug-names --module-name="app" --num-outputs=8 apps/$(APP)/app.wasm -o src/wasm-app.c
clean:
-@rm ./src/wasm-app*
-@rm -rf ./build ./.pio
-@rm *_firmware_*.bin
### Particle helpers
DEVICE ?= "Photon"
DEV_TYPE ?= photon
particle_compile: all
@particle compile $(DEV_TYPE) ./src/*
particle_erase:
@particle usb dfu
@particle flash --usb tinker
particle_upload: all
@particle flash $(DEVICE) ./src/*
particle_upload_usb: particle_compile
@particle usb dfu
@particle flash --usb *_firmware_*.bin
-@rm *_firmware_*.bin
particle_monitor:
@particle serial monitor --follow
particle_run: particle_upload particle_monitor
### PlatformIO helpers
ENV ?= esp32
pio_compile: all
@pio run -e $(ENV)
pio_upload: all
@pio run -e $(ENV) -t upload
pio_monitor:
@pio device monitor --quiet
pio_run: pio_upload pio_monitor