This repository has been archived by the owner on Aug 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
64 lines (44 loc) · 1.81 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
export PATH := $(PWD)/esp-open-sdk/xtensa-lx106-elf/bin:$(PWD)/micropython/tools:$(PWD)/micropython/ports/unix:$(HOME)/go/bin:$(PATH)
VERSION := 0.1.0-alpha
MICROPYVERSION := 1.9.4
PORT := /dev/ttyUSB0
all: clean bin2res templates copy firmware
requirements:
micropython -m upip install -p micropython/ports/esp8266/modules -r requirements.txt
cp lib/* micropython/ports/esp8266/modules
bin2res: style
cd wizard; mpy_bin2res.py static/style.min.css > R.py
copy: clear-templates
cp -rf wizard micropython/ports/esp8266/modules
cp inisetup.py micropython/ports/esp8266/modules
firmware:
cd micropython/ports/esp8266; make
copy-firmware:
cp micropython/ports/esp8266/build/firmware-combined.bin ./microhomie-wizard-v$(VERSION).bin
release: requirements clean bin2res templates copy firmware copy-firmware
clean:
cd micropython/ports/esp8266; make clean
-rm -rf micropython/ports/esp8266/modules/wizard
deploy: erase flash
erase:
esptool.py --port $(PORT) --baud 460800 erase_flash
flash:
esptool.py --port $(PORT) --baud 460800 write_flash --flash_size=detect --verify -fm dio 0 micropython/ports/esp8266/build/firmware-combined.bin
style:
cd wizard/static; minify -o style.min.css style.css
templates: clear-templates
MICROPYPATH=lib micropython -c 'import wizard.app; wizard.app.preload_templates()'
clear-templates:
-rm wizard/templates/*.py
go-minify:
go get github.com/tdewolff/minify/cmd/minify
espopensdk:
git clone --recursive https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk; make
micropython:
git clone --recursive https://github.com/micropython/micropython.git
cd micropython; git checkout -b $(MICROPYVERSION)
cd micropython; make -C mpy-cross
cd micropython/ports/unix; make axtls; make
cd micropython; git apply ../micropython.patch
bootstrap: espopensdk micropython go-minify requirements