lua != which lua
luac != which luac

extens = $(wildcard ext/*.lua)
extens_names ?= $(basename $(notdir $(extens)))

cortav: sirsem.lua cortav.lua $(extens) cli.lua
	@echo ' » building with extensions $(extens_names)'
	echo '#!$(lua)' > $@
	luac -o - $^ >> $@
	chmod +x $@

cortav.html: cortav.ct cortav
	./cortav $< -o $@ -m render:format html -y html:fossil-uv

.PHONY: syncdoc
syncdoc: cortav.html
	fossil uv add $<
	fossil uv sync
