1 CABAL := $(shell find . -maxdepth 1 -name '*.cabal' -print -quit)
6 stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
10 ! grep -q '^Test-Suite\>' $(CABAL) || \
11 { stack $(STACK_FLAGS) test $(STACK_TEST_FLAGS); }
14 stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
16 stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
18 %/fast: override STACK_BUILD_FLAGS+=--fast
19 %/fast: override STACK_HADDOCK_FLAGS+=--fast
20 %/fast: override STACK_TEST_FLAGS+=--fast
25 stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
27 markdown $*.md >$*.html
29 sensible-browser $*.html
31 HLint.hs: $(shell find . -name '*.hs' -not -name 'HLint.hs')
32 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
33 echo '-- BEGIN: generated hints' >> HLint.hs
34 hlint --find . | grep '^'infix | sort -u >> HLint.hs
35 echo '-- END: generated hints' >> HLint.hs
38 if hlint --quiet --report=hlint.html -XNoCPP \
39 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$(CABAL)) $(HLINT_FLAGS) .; \
40 then rm -f hlint.html; \
41 else sensible-browser ./hlint.html & fi
44 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$(CABAL)"); \
45 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$(CABAL)"); \
46 git tag --merged | grep -Fqx "$$name-$$version" || \
47 git tag -f -s -m "$$name v$$version" $$name-$$version
50 stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
52 LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
58 sensible-browser stats/index.html