- .githooks/pre-commit: runs 'make netdeck-test-unit' (fast layer: unit + integration) before every commit; bypass with --no-verify - make hooks: enables the hook for a clone (core.hooksPath .githooks) - AGENTS.md: toolchain, one-command build/test entry points, hook install instructions, commit discipline
50 lines
2.0 KiB
Makefile
50 lines
2.0 KiB
Makefile
# T-Deck workspace — one common build command per app that builds BOTH
|
|
# targets (SDL2 emulator + ESP32-S3 firmware), so a change can never leave
|
|
# one of them silently broken.
|
|
#
|
|
# make netdeck build the NetDeck emulator AND the T-Deck firmware
|
|
# make netdeck-test run the full headless test suite:
|
|
# unit + integration (fast, deterministic)
|
|
# + E2E journeys (separate build, real loop(),
|
|
# ~1-2 min wall time)
|
|
# make netdeck-test-unit fast layer only (unit + integration, seconds) —
|
|
# also what the pre-commit hook runs
|
|
# make netdeck-test-e2e E2E layer only
|
|
# make hooks enable the pre-commit hook for this clone
|
|
# (= git config core.hooksPath .githooks)
|
|
#
|
|
# Firmware builds need platformio: either `pio` on PATH or the default
|
|
# ~/.platformio/penv/bin/pio install.
|
|
|
|
PIO := $(shell command -v pio 2>/dev/null || echo $(HOME)/.platformio/penv/bin/pio)
|
|
|
|
ifeq ($(wildcard $(PIO)),)
|
|
$(error pio not found — put it on PATH or install to ~/.platformio)
|
|
endif
|
|
|
|
netdeck:
|
|
@echo "=== [1/2] NetDeck firmware (ESP32-S3, pio) ==="
|
|
$(PIO) run -d examples/NetDeck
|
|
@echo "=== [2/2] NetDeck emulator (SDL2) ==="
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck
|
|
@echo "=== both NetDeck targets built OK ==="
|
|
|
|
netdeck-test:
|
|
@echo "=== NetDeck tests: unit + integration + E2E ==="
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
|
|
|
|
netdeck-test-unit:
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test
|
|
|
|
netdeck-test-e2e:
|
|
$(MAKE) --no-print-directory -C emulator APP=NetDeck test-e2e
|
|
|
|
# install the pre-commit hook into this clone (hooks are not versioned in
|
|
# .git/hooks; the repo ships them under .githooks/ instead)
|
|
hooks:
|
|
git config core.hooksPath .githooks
|
|
@echo "pre-commit hook enabled: make netdeck-test-unit runs before every commit"
|
|
|
|
.PHONY: netdeck netdeck-test netdeck-test-unit netdeck-test-e2e hooks
|