all: asset-sync doc-sync

repo-uri = https://c.hale.su/starlit

starlit.html: starlit.ct
	cortav -y html:fossil-uv "$<" -o "$@"

.PHONY: doc-sync
doc-sync: starlit.html
	fossil uv add "$<"
	fossil uv sync

asset.cpxz: asset.list $(shell cat asset.list)
	cpio -o <"$<" | xz >"$@"

.PHONY: asset-sync
asset-sync: asset.cpxz
	fossil uv add "$<"
	fossil uv sync

.PHONY: unpack
unpack:
	fossil uv ex asset.cpxz asset.cpxz || curl $(repo-uri)/uv/asset.cpxz -o asset.cpxz
	xzcat asset.cpxz | cpio -i