# 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
#
# 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 ==="

.PHONY: netdeck
