1 CABAL := $(shell find . -name '*.cabal' -print -quit)
2 HS := $(shell find . -name '*.hs')
7 stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
11 ! grep -q '^Test-Suite\>' $(CABAL) || \
12 { stack $(STACK_FLAGS) test $(STACK_TEST_FLAGS); }
15 stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
17 stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
19 %/fast: override STACK_BUILD_FLAGS+=--fast
20 %/fast: override STACK_HADDOCK_FLAGS+=--fast
21 %/fast: override STACK_TEST_FLAGS+=--fast
26 stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
28 markdown $*.md >$*.html
30 sensible-browser $*.html
33 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
34 echo '-- BEGIN: generated hints' >> HLint.hs
35 hlint --find . | grep '^'infix | sort -u >> HLint.hs
36 echo '-- END: generated hints' >> HLint.hs
39 if hlint --quiet --report=hlint.html -XNoCPP \
40 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$(CABAL)) $(HLINT_FLAGS) .; \
41 then rm -f hlint.html; \
42 else sensible-browser hlint.html & fi
45 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$(CABAL)"); \
46 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$(CABAL)"); \
47 git tag --merged | grep -Fqx "$$name-$$version" || \
48 git tag -f -s -m "$$name v$$version" $$name-$$version
51 stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
53 LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
59 sensible-browser stats/index.html