1 override RTS_OPTIONS += -L100
2 override TEST_OPTIONS += --color always --size-cutoff 1000000 $(addprefix -p ,$t)
3 override GHC_PROF_OPTIONS += -fprof-auto -fprof-auto-calls
4 override BENCHMARK_OPTIONS += --output benchmarks/html/$(version).html --match glob $b
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 cabal repl $(project):parsers
23 cabal test $(CABAL_TEST_FLAGS) \
24 --test-show-details always --test-options "$(TEST_OPTIONS)"
25 tests/prof-time: $(project)-test.eventlog.json
26 tests/prof-heap: $(project)-test.eventlog.html
27 .PHONY: $(project)-test.eventlog
28 $(project)-test.eventlog $(project)-test.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 v2-build lib:$(project) --enable-profiling $(GHC_PROF_OPTIONS) --write-ghc-environment-files=always
34 cabal test $(CABAL_TEST_FLAGS) \
35 --test-show-details always --test-options "$(TEST_OPTIONS) +RTS $(RTS_OPTIONS)" \
36 --enable-profiling $(GHC_PROF_OPTIONS) \
37 --ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
39 cabal repl --enable-tests $(project)-test
41 %/accept: TEST_OPTIONS += --accept
44 %/cover: CABAL_TEST_FLAGS += --enable-coverage
47 %.eventlog.html: RTS_OPTIONS += -hy -l-au
48 %.eventlog.html: %.eventlog
50 %.eventlog.json: RTS_OPTIONS += -p -l-au
51 %.eventlog.json: %.eventlog
54 .PHONY: benchmarks/html/$(version).html
55 b benchmarks: benchmarks/html/$(version).html
56 benchmarks/html/$(version).html:
57 mkdir -p benchmarks/html
58 cabal bench $(CABAL_BENCH_FLAGS) --benchmark-options "$(BENCHMARK_OPTIONS)"
60 cabal repl --enable-benchmarks $(project)-benchmark
61 benchmarks/prof-time: $(project)-benchmark.eventlog.json
62 benchmarks/prof-heap: $(project)-benchmark.eventlog.html
63 .PHONY: $(project)-benchmark.eventlog
64 $(project)-benchmark.eventlog $(project)-benchmark.prof:
65 cabal bench $(CABAL_BENCH_FLAGS) \
66 --benchmark-options "$(BENCHMARK_OPTIONS) +RTS $(RTS_OPTIONS)" \
67 --enable-profiling $(GHC_PROF_OPTIONS)
68 $(project)-benchmark.prof2:
69 cabal v2-build lib:$(project) --enable-profiling $(GHC_PROF_OPTIONS) --write-ghc-environment-files=always
70 cabal bench $(CABAL_BENCH_FLAGS) \
71 --benchmark-options "$(BENCHMARK_OPTIONS)" \
72 --enable-profiling $(GHC_PROF_OPTIONS) \
73 --ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
76 cabal haddock --haddock-css ocean --haddock-hyperlink-source
79 git tag --merged | grep -Fqx "$(package)-$(version)" || \
80 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
84 cabal haddock --haddock-for-hackage --enable-doc
87 cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz
88 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz
89 %/publish: CABAL_UPLOAD_FLAGS+=--publish
92 publish: upload/publish
97 nix flake update --recreate-lock-file
99 nix -L develop --command cabal repl