all: build
configure:
	echo "noop"
build: isqc1.cabal
	@echo "Building with cabal..."
	@temp_log=$$(mktemp); \
	cabal build 2> >(tee $$temp_log >&2)  || true; \
	if grep -q "hackage.haskell.org" $$temp_log ; then \
		make update && cabal build;\
	fi; rm -f $$temp_log
update:
	@echo "Running cabal update..."
	@cabal update

test: isqc1.cabal
	cabal test
isqc1.cabal: package.yaml
	hpack


.PHONY: all build clean test

clean:
	rm -rf isqc1.cabal dist
