forked from cbrand/micropython-mdns
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
77 lines (50 loc) · 2.37 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
74
75
76
77
.DEFAULT_GOAL := build-compile
build-compile: build compile
TTY_PORT?=/dev/ttyUSB0
PWD?=$(shell pwd)
DNS_VOLUME_NAME?=mdns-build-volume
NEWEST_MICROPYTHON_VERSION?=1.20
erase:
esptool.py --chip esp32 --port ${TTY_PORT} erase_flash
flash:
esptool.py --chip esp32 --port ${TTY_PORT} write_flash -z 0x1000 firmware.bin
copy-main:
ampy -p ${TTY_PORT} put main.py /main.py
copy: copy-main
create-data-volume:
docker volume create ${DNS_VOLUME_NAME}
compile-micropython-1-15: create-data-volume
MICROPYTHON_VERSION=1.15 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-micropython-1-16: create-data-volume
MICROPYTHON_VERSION=1.16 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-micropython-1-17: create-data-volume
MICROPYTHON_VERSION=1.17 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-micropython-1-18: create-data-volume
MICROPYTHON_VERSION=1.18 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-micropython-1-19: create-data-volume
MICROPYTHON_VERSION=1.19 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-micropython-1-20: create-data-volume
MICROPYTHON_VERSION=1.20 DNS_VOLUME_NAME=${DNS_VOLUME_NAME} ./build-and-copy-firmware.sh
compile-newest: compile-micropython-1-20
docker run --rm -v "${DNS_VOLUME_NAME}:/opt/copy" -t esp32-mdns-client:micropython.${NEWEST_MICROPYTHON_VERSION} cp build-MDNS/firmware.bin /opt/copy/firmware.bin
docker create -v ${DNS_VOLUME_NAME}:/data --name helper busybox true
docker cp helper:/data/firmware.bin ./firmware.bin
docker rm helper
compile: compile-micropython-1-15 compile-micropython-1-16 compile-micropython-1-17 compile-micropython-1-18 compile-micropython-1-19 compile-micropython-1-20
install: erase compile flash copy-certs copy-main
micropython-build-shell: compile-micropython-1-20
docker run --rm -t esp32-mdns-client:micropython.1.20 bash
compile-and-flash: compile-newest flash
compile-and-shell: compile-and-flash shell
shell:
picocom ${TTY_PORT} -b115200
build-and-upload: build upload
mip-json:
python generate-package-json.py
build: mip-json
rm -rf src/dist/*.tar.gz*
cd src && python setup.py sdist
upload:
twine upload src/dist/*.tar.gz
generatecligif:
docker run --rm -t -u $$(id -u) -v $(CURDIR):/data asciinema/asciicast2gif -w 116 -h 20 images/service-discovery.rec images/service-discovery.gif