-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (43 loc) · 2.24 KB
/
Copy pathMakefile
File metadata and controls
63 lines (43 loc) · 2.24 KB
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
SHELL := /bin/bash
# ESP-IDF activation script — override if yours lives elsewhere:
# make fw-43c IDF_ACTIVATE=/path/to/activate_idf_vX.Y.Z.sh
IDF_ACTIVATE ?= $(HOME)/.espressif/tools/activate_idf_v6.0.1.sh
# 4.3C build needs a separate build dir + sdkconfig fragment (selects the board)
FW_43C_FLAGS := -B build_43c -DSDKCONFIG=sdkconfig.43c \
-DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.43c.defaults"
# Optional serial port for flash targets: make fw-flash-147b PORT=/dev/cu.usbmodemXXX
PORT_ARG := $(if $(PORT),-p $(PORT),)
.PHONY: help \
host host-test host-install \
fw-147b fw-43c fw-flash-147b fw-flash-43c fw-clean \
clean release release-snapshot
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN{FS=":.*?## "}{printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}'
## ---------------- host (Go) ----------------
host: ## Build host binary -> host/tokenpulse
cd host && go build -o tokenpulse .
host-test: ## Run host tests
cd host && go test ./...
host-install: ## Install host binary -> $(go env GOPATH)/bin/tokenpulse
cd host && go build -o "$$(go env GOPATH)/bin/tokenpulse" .
## ---------------- firmware (ESP-IDF) ----------------
fw-147b: ## Build firmware for ESP32-S3-LCD-1.47B (default board)
source $(IDF_ACTIVATE) && cd firmware && idf.py build
fw-43c: ## Build firmware for ESP32-S3-Touch-LCD-4.3C
source $(IDF_ACTIVATE) && cd firmware && idf.py $(FW_43C_FLAGS) build
fw-flash-147b: ## Flash + monitor 1.47B (PORT=... optional)
source $(IDF_ACTIVATE) && cd firmware && idf.py $(PORT_ARG) flash monitor
fw-flash-43c: ## Flash + monitor 4.3C (PORT=... optional)
source $(IDF_ACTIVATE) && cd firmware && idf.py $(FW_43C_FLAGS) $(PORT_ARG) flash monitor
fw-clean: ## Remove firmware build dirs
rm -rf firmware/build firmware/build_43c
## ---------------- release (host, goreleaser) ----------------
release-snapshot: ## Local goreleaser dry-run (no publish, artifacts in dist/)
goreleaser release --snapshot --clean
release: ## goreleaser release — needs a pushed git tag + GITHUB_TOKEN
goreleaser release --clean
## ---------------- misc ----------------
clean: fw-clean ## Clean firmware builds + host binary + dist/
rm -f host/tokenpulse
rm -rf dist