5 HS = $(shell find $(PKGS) -name '*.hs' -not -name 'HLint.hs')
11 cd $* && stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
12 .PHONY: $(PKGS) $(foreach p,$(PKGS),$(eval $p: $p/build))
14 .PHONY: $(PKGS:=/test)
18 ! grep -q '^Test-Suite\>' $p/$p.cabal || \
19 { cd $p && stack $$(STACK_FLAGS) test $$(STACK_TEST_FLAGS); }
21 $(foreach p,$(PKGS),$(eval $(call test)))
24 GHCID_TEST ?= ":main $(GHCID_TEST_ARGS)"
25 ghcid: $(PKGS:=/ghcid)
29 --command "stack $(STACK_FLAGS) $(GHCID_STACK_FLAGS) ghci $(GHCID_GHCI_FLAGS) \
30 $$(2>&1 stack ide targets | grep -v :test:) \
31 --ghci-options=-fobject-code" \
32 --test $(GHCID_TEST) \
35 clean: $(PKGS:=/clean)
36 cleaner: $(PKGS:=/cleaner)
38 cd $* && stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
40 cd $* && stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
42 %/fast: override STACK_BUILD_FLAGS+=--fast
43 %/fast: override STACK_HADDOCK_FLAGS+=--fast
44 %/fast: override STACK_TEST_FLAGS+=--fast
47 %/accept: override STACK_TEST_ARGS+=--accept
53 cd $* && stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
55 markdown $*.md >$*.html
57 sensible-browser $*.html
60 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
61 echo '-- BEGIN: generated hints' >> HLint.hs
62 hlint -XTypeApplications $(foreach p,$(PKGS),--find $p) | sed -ne 's/^- infix: "\([^"]*\)"/\1/p' | sort -u >>HLint.hs
63 echo '-- END: generated hints' >> HLint.hs
65 lint: $(PKGS:=/lint) $(HS)
67 cd $* && if hlint --quiet --report=hlint.html -XNoCPP \
68 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$*) $(HLINT_FLAGS) .; \
69 then rm -f hlint.html; \
70 else sensible-browser ./hlint.html & fi
75 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$$cabal"); \
76 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$$cabal"); \
77 git tag --merged | grep -Fqx "$$name-$$version" || \
78 git tag -f -s -m "$$name v$$version" $$name-$$version
82 cd $* && stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
83 upload: $(PKGS:=/upload)
85 cd $* && LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
91 sensible-browser stats/index.html