6 HS = $(shell find $(PKGS) -name '*.hs' -not -name 'HLint.hs')
10 build: $(PKGS:=/build)
12 cd $* && stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
13 .PHONY: $(PKGS) $(foreach p,$(PKGS),$(eval $p: $p/build))
15 .PHONY: $(PKGS:=/test)
19 ! grep -q '^Test-Suite\>' $p/$p.cabal || \
20 { cd $p && stack $$(STACK_FLAGS) test $$(STACK_TEST_FLAGS); }
22 $(foreach p,$(PKGS),$(eval $(call test)))
25 GHCID_TEST ?= ":main $(GHCID_TEST_ARGS)"
26 ghcid: $(PKGS:=/ghcid)
30 --command "stack $(STACK_FLAGS) $(GHCID_STACK_FLAGS) ghci $(GHCID_GHCI_FLAGS) \
31 $$(2>&1 stack ide targets | grep -v :test:) \
32 --ghci-options=-fobject-code" \
33 --test $(GHCID_TEST) \
36 clean: $(PKGS:=/clean)
37 cleaner: $(PKGS:=/cleaner)
39 cd $* && stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
41 cd $* && stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
43 %/fast: override STACK_BUILD_FLAGS+=--fast
44 %/fast: override STACK_HADDOCK_FLAGS+=--fast
45 %/fast: override STACK_TEST_FLAGS+=--fast
48 %/accept: override STACK_TEST_ARGS+=--accept
54 cd $* && stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
56 markdown $*.md >$*.html
58 sensible-browser $*.html
61 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
62 echo '-- BEGIN: generated hints' >> HLint.hs
63 hlint $(foreach p,$(PKGS),--find $p) | grep '^'infix | sort -u >> HLint.hs
64 echo '-- END: generated hints' >> HLint.hs
66 lint: $(PKGS:=/lint) $(HS)
68 cd $* && if hlint --quiet --report=hlint.html -XNoCPP \
69 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$*) $(HLINT_FLAGS) .; \
70 then rm -f hlint.html; \
71 else sensible-browser ./hlint.html & fi
76 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$$cabal"); \
77 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$$cabal"); \
78 git tag --merged | grep -Fqx "$$name-$$version" || \
79 git tag -f -s -m "$$name v$$version" $$name-$$version
83 cd $* && stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
84 upload: $(PKGS:=/upload)
86 cd $* && LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
92 sensible-browser stats/index.html