1 override GHCID_OPTIONS += --no-height-limit --reverse-errors
2 override REPL_OPTIONS += -ignore-dot-ghci
4 cabal := $(wildcard *.cabal)
5 package := $(notdir ./$(cabal:.cabal=))
6 version := $(shell sed -ne 's/^version: *\(.*\)/\1/p' $(cabal))
7 project := $(patsubst %.cabal,%,$(cabal))
8 cabal_builddir ?= dist-newstyle
12 cabal build $(CABAL_BUILD_FLAGS)
16 cabal repl $(CABAL_REPL_FLAGS) $(project)
18 ghcid $(GHCID_OPTIONS) --command 'cabal repl -fno-code $(CABAL_REPL_FLAGS) $(project) $(addprefix --repl-options ,$(REPL_OPTIONS))'
21 cabal haddock --haddock-css ocean --haddock-hyperlink-source
24 git tag --merged | grep -Fqx "$(package)-$(version)" || \
25 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
31 cabal haddock --haddock-for-hackage --enable-doc
34 git tag --merged | grep -Fqx $(package)-$(version)
35 git push --follow-tags $(GIT_PUSH_FLAGS)
36 cabal upload $(CABAL_UPLOAD_FLAGS) "$(cabal_builddir)"/sdist/$(package)-$(version).tar.gz
37 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation "$(cabal_builddir)"/$(package)-$(version)-docs.tar.gz
38 %/publish: CABAL_UPLOAD_FLAGS+=--publish
41 publish: upload/publish
44 .hlint.yaml: $(shell find src -name '*.hs' -not -name 'HLint.hs')
45 sed -i -e '/^# BEGIN: generated hints/,/^# END: generated hints/d' $@
46 echo >>$@ '# BEGIN: generated hints'
47 hlint --find . | grep -- '- fixity:' | sort -u >>$@
48 echo >>$@ '# END: generated hints'
50 if hlint --quiet --report=hlint.html -XNoCPP $(HLINT_FLAGS) .; \
51 then rm -f hlint.html; \
52 else sensible-browser ./hlint.html & fi