Files
slate32/Makefile
T
evan 7510bb38a5 feat(sdcard)!: move the card to /.lua and the shared Lua API
Apps live under /.lua/apps with data in /.lua/data, matching the runtime's
paths. ui.lua and hints.lua ship from the submodule through `make sdcard`
rather than a copy that drifts, so theme.lua and the firmware's own ui.lua
are gone.

App-visible changes: text takes a font role rather than a text size, the
theme palette names roles (color/background) instead of fg/bg, ticks are
timer.every, on_press is on_click, and centring is layout alignment now
that textAlign left the node contract.
2026-08-03 18:32:58 -04:00

50 lines
1.6 KiB
Makefile

# Run inside `nix develop`, which provides pio, lua and a compiler.
# LUA is pinned to 5.4 to match the interpreter vendored into the firmware.
LUA ?= lua
CXX ?= c++
CXXFLAGS ?= -std=c++11 -Wall -Wextra
BUILD_DIR := .pio/build/esp32-32e
SHARED_LUA := lib/esp32-lua-api/lua/lib
LUA_TESTS := test/keyboard.lua test/settings_calibration.lua test/statusbar_dirty.lua test/settings_busy.lua
.PHONY: test test-lua test-cpp test-shared sdcard build upload monitor clean
# The shared modules ship from the submodule rather than a copy in this repo, so an app
# on the card and an app on the host resolve the same ui.lua. Run before flashing or
# booting the emulator, both of which read sdcard/ directly.
sdcard:
@cp $(SHARED_LUA)/*.lua sdcard/.lua/lib/
@echo "sdcard/.lua/lib <- $(SHARED_LUA)"
# The layout engine, the shared modules and the API declarations are tested in
# lib/esp32-lua-api; what is left here is this firmware's own Lua and gfx.
test: test-cpp test-lua test-shared
test-shared:
@$(MAKE) -C lib/esp32-lua-api test
test-lua:
@$(LUA) -e 'assert(_VERSION == "Lua 5.4", "tests need Lua 5.4 to match the firmware, got " .. _VERSION)'
@for t in $(LUA_TESTS); do printf '%-32s ' "$$t"; $(LUA) "$$t" || exit 1; done
test-cpp: $(BUILD_DIR)/round_rect_test
@printf '%-32s ' test/round_rect_test.cpp; $(BUILD_DIR)/round_rect_test
$(BUILD_DIR)/round_rect_test: test/round_rect_test.cpp src/gfx/round_rect.h
@mkdir -p $(@D)
@$(CXX) $(CXXFLAGS) $< -o $@
build:
pio run
upload:
pio run -t upload
monitor:
pio device monitor
clean:
pio run -t clean
rm -f $(BUILD_DIR)/round_rect_test