1 override RTS_OPTIONS += -L100
2 override TEST_OPTIONS += --color always $(addprefix -p ,$t)
3 override GHC_PROF_OPTIONS += -fprof-auto -fprof-auto-calls
4 override REPL_OPTIONS += -ignore-dot-ghci
6 cabal := $(wildcard *.cabal)
7 package := $(notdir ./$(cabal:.cabal=))
8 version := $(shell sed -ne 's/^version: *\(.*\)/\1/p' $(cabal))
9 project := $(patsubst %.cabal,%,$(cabal))
19 ghcid -c 'cabal repl $(project) --repl-options "$(REPL_OPTIONS)"' --reverse-errors
23 cabal test $(CABAL_TEST_FLAGS) \
24 --test-show-details always --test-options "$(TEST_OPTIONS)"
25 tests/prof-time: $(project)-tests.eventlog.json
26 tests/prof-heap: $(project)-tests.eventlog.html
27 .PHONY: $(project)-tests.eventlog
28 $(project)-tests.eventlog $(project)-tests.prof:
29 cabal test $(CABAL_TEST_FLAGS) \
30 --test-show-details always --test-options "$(TEST_OPTIONS) +RTS $(RTS_OPTIONS)" \
31 --enable-profiling $(GHC_PROF_OPTIONS) || true
33 cabal repl --enable-tests $(project)-tests
35 %/accept: TEST_OPTIONS += --accept
38 %/cover: CABAL_TEST_FLAGS += --enable-coverage
43 cabal haddock --haddock-css ocean --haddock-hyperlink-source
46 git tag --merged | grep -Fqx "$(package)-$(version)" || \
47 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
51 cabal haddock --haddock-for-hackage --enable-doc
54 cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz
55 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz
56 %/publish: CABAL_UPLOAD_FLAGS+=--publish
59 publish: upload/publish
64 nix flake update --recreate-lock-file
66 nix -L develop --command cabal repl