#!/usr/bin/make -f

override_dh_auto_clean:
	find $(CURDIR) -name "*.agdai" -delete
	rm -rf $(CURDIR)/html
	rm -f $(CURDIR)/GenerateEverything{,.hi.o}
	dh_auto_clean

override_dh_auto_build:
	ghc --make GenerateEverything.hs
	./GenerateEverything
	agda +RTS -K1G -RTS -i $(CURDIR) -i $(CURDIR)/src $(CURDIR)/Everything.agda
	agda --html -i $(CURDIR) -i $(CURDIR)/src $(CURDIR)/README.agda

# Don't use upstream's 'make install'
override_dh_auto_install:

override_dh_auto_test:
	agda -i $(CURDIR) -i $(CURDIR)/src README.agda

%:
	dh $@
