# Copyright 2026 Stephen Bouche
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Two steps, as for the other Lua packages: luapack.py writes the script
# container with the Lua flag set, and vesc_tool embeds it through pkgLua.
# VE points at the vesc_express checkout the packer comes from.

VESC_TOOL ?= vesc_tool
VE ?= $(firstword $(wildcard ../../vesc_express ../../express))
LUAPACK = $(VE)/tools/luapack.py

all: tone_seq_lua.vescpkg

tone_seq_lua.vescpkg: tone_seq.luapkg README.md pkgdesc.qml
	$(VESC_TOOL) --buildPkgFromDesc pkgdesc.qml --testPkgDesc 'custom:test' --testPkgDesc 'vesc:test'

tone_seq.luapkg: tone_seq.lua
	python3 $(LUAPACK) tone_seq.lua -o $@

test:
	./test/run.sh

clean:
	rm -f tone_seq_lua.vescpkg tone_seq.luapkg

.PHONY: all clean test
