-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
37 lines (31 loc) · 1.04 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
SHELL := /bin/bash
.DEFAULT_GOAL := help
.PHONY: help
help: ## help target to show available commands with information
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: all
all: build-frontend build-firmware upload-firmware upload-fs
.PHONY: build-frontend
build-frontend: # build web frontend and prepare data directory for FS build
cd web && ./build.sh && cd ..
rm -Rf ./data/css
rm -Rf ./data/js
rm -Rf ./data/favicon.ico
rm -Rf ./data/index.html
cp -r ./web/dist/* ./data/
find ./data/ -name "*.css" -exec rm -rf {} \;
find ./data/ -name "*.css.br" -exec rm -rf {} \;
find ./data/ -name "*.js" -exec rm -rf {} \;
find ./data/ -name "*.js.br" -exec rm -rf {} \;
find ./data/ -name "*.map" -exec rm -rf {} \;
find ./data/ -name "*.html.br" -exec rm -rf {} \;
## pio related
.PHONY: build-firmware
build-firmware:
platformio run
.PHONY: upload-firmware
upload-firmware:
platformio run -t upload
.PHONY: upload-fs
upload-fs:
platformio run -t uploadfs