1 cabal := $(shell find . -name '*.cabal' -print -quit)
2 package := $(notdir ./$(cabal:.cabal=))
3 #package := $(shell 2>&1 stack ide packages)
9 stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
13 ! grep -q '^Test-Suite\>' $(cabal) || \
14 { stack $(STACK_FLAGS) test $(STACK_TEST_FLAGS) --test-arguments "$(STACK_TEST_ARGS)"; }
17 GHCID_TEST ?= ":main --color always $(GHCID_TEST_ARGS)"
19 ghcid --color=always \
21 --command "stack $(STACK_FLAGS) $(GHCID_STACK_FLAGS) ghci $(GHCID_GHCI_FLAGS) --test \
22 $(shell 2>&1 stack ide targets) \
23 --ghci-options=-fobject-code" \
24 --test $(GHCID_TEST) \
28 stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
30 stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
32 %/fast: override STACK_BUILD_FLAGS+=--fast
33 %/fast: override STACK_HADDOCK_FLAGS+=--fast
34 %/fast: override STACK_TEST_FLAGS+=--fast
38 %/debug: override STACK_BUILD_FLAGS+=--flag $(cabal:.cabal=):debug
39 %/debug: override STACK_TEST_FLAGS+=--flag $(cabal:.cabal=):debug
43 %/accept: override STACK_TEST_ARGS+=--accept
48 stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
50 markdown $*.md >$*.html
52 sensible-browser $*.html
54 .hlint.yaml: $(shell find src -name '*.hs' -not -name 'HLint.hs')
55 sed -i -e '/^# BEGIN: generated hints/,/^# END: Generated by hlint/d' $@
56 echo >>$@ '# BEGIN: generated hints'
57 hlint --find . | sed -ne 's/^- fixity:/- fixity:/p' | sort -u >>$@
58 echo >>$@ '# END: generated hints'
61 if hlint --quiet --report=hlint.html $(HLINT_FLAGS) .; \
62 then rm -f hlint.html; \
63 else sensible-browser ./hlint.html & fi
66 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$(cabal)"); \
67 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$(cabal)"); \
68 git tag --merged | grep -Fqx "$$name-$$version" || \
69 git tag -f -s -m "$$name v$$version" $$name-$$version
72 stack $(STACK_FLAGS) sdist $(STACK_SDIST_FLAGS)
74 LANG=C stack $(STACK_FLAGS) upload $(STACK_UPLOAD_FLAGS) .
80 sensible-browser stats/index.html