preprocess:
	find ./ -name '*.lua2p' | xargs -L1 -I %% lua lib/preprocess-cl.lua %%

check: preprocess
	stylua -c --indent-type Spaces ./
	luacheck -d --no-self --globals bit tiny T Arr Maybe TextStyle $$(grep "^[A-Z]" generated/assets.lua | awk '{print $$1}' | tr '\n' ' ') --codes ./ --exclude-files ./test/ ./generated/ ./lib/ ./tiny-*

test: check
	find ./test -name '*.lua' | xargs -L1 -I %% lua %% -v

lint:
	stylua --indent-type Spaces ./

build: preprocess
	# zip -r Game.love ./*
	love-build "$$(pwd)/main.lua"