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