1 CABAL := $(shell find . -name '*.cabal' -print -quit)
2 HS := $(shell find . -name '*.hs')
3 QUICKCHECK_TESTS = 1000
4 QUICKCHECK_MAXSIZE = 100
5 TEST_FLAGS = --quickcheck-tests $(QUICKCHECK_TESTS) --quickcheck-max-size $(QUICKCHECK_MAXSIZE)
10 stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
14 ! grep -q '^Test-Suite\>' $(CABAL) || \
15 { stack $(STACK_FLAGS) test --test-arguments "$(TEST_FLAGS)" $(STACK_TEST_FLAGS); }
18 stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
20 stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
22 %/fast: override STACK_BUILD_FLAGS+=--fast
23 %/fast: override STACK_HADDOCK_FLAGS+=--fast
24 %/fast: override STACK_TEST_FLAGS+=--fast
25 %/fast: override QUICKCHECK_TESTS=100
26 %/fast: override QUICKCHECK_MAXSIZE=100
31 stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
33 markdown $*.md >$*.html
35 sensible-browser $*.html
38 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
39 echo '-- BEGIN: generated hints' >> HLint.hs
40 hlint --find . | grep '^'infix | sort -u >> HLint.hs
41 echo '-- END: generated hints' >> HLint.hs
44 if hlint --quiet --report=hlint.html -XNoCPP \
45 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$(CABAL)) $(HLINT_FLAGS) .; \
46 then rm -f hlint.html; \
47 else sensible-browser hlint.html & fi
50 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$(CABAL)"); \
51 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$(CABAL)"); \
52 git tag --merged | grep -Fqx "$$name-$$version" || \
53 git tag -f -s -m "$$name v$$version" $$name-$$version
56 LANG=C stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
58 LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
64 sensible-browser stats/index.html