.PHONY: watch run

default: bin/rewild.hl

SOURCES := $(shell find . -name \*.hx -print)

bin/rewild.hl: $(SOURCES)
	haxe compile-hl.hxml

bin/rewild.js: $(SOURCES)
	haxe compile-js.hxml

debug: $(SOURCES)
	haxe --debug compile-hl.hxml

clean:
	rm -f bin/rewild.hl bin/rewild.js

watch:
	@inotifywait --recursive --monitor --event modify,move,create,delete --include '.*.hx$$' ./ | while read changed; do echo $$changed; make debug; done

run:
	hl bin/rewild.hl
