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
22 cabal test $(CABAL_TEST_FLAGS) \
23 --test-show-details always --test-options "$(TEST_OPTIONS)"
24 tests/prof-time: $(project)-test.eventlog.json
25 tests/prof-heap: $(project)-test.eventlog.html
26 .PHONY: $(project)-test.eventlog
27 $(project)-test.eventlog $(project)-test.prof:
28 cabal test $(CABAL_TEST_FLAGS) \
29 --test-show-details always --test-options "$(TEST_OPTIONS) +RTS $(RTS_OPTIONS)" \
30 --enable-profiling $(GHC_PROF_OPTIONS) || true
32 cabal v2-build lib:$(project) --enable-profiling $(GHC_PROF_OPTIONS) --write-ghc-environment-files=always
33 cabal test $(CABAL_TEST_FLAGS) \
34 --test-show-details always --test-options "$(TEST_OPTIONS) +RTS $(RTS_OPTIONS)" \
35 --enable-profiling $(GHC_PROF_OPTIONS) \
36 --ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
38 cabal repl --enable-tests $(project)-test
40 %/accept: TEST_OPTIONS += --accept
43 %/cover: CABAL_TEST_FLAGS += --enable-coverage
46 %.eventlog.html: RTS_OPTIONS += -hy -l-au
47 %.eventlog.html: %.eventlog
49 %.eventlog.json: RTS_OPTIONS += -p -l-au
50 %.eventlog.json: %.eventlog
53 b benchmarks/html/$(version).html:
54 mkdir -p benchmarks/html
55 cabal bench $(CABAL_BENCH_FLAGS) --benchmark-options "$(BENCHMARK_OPTIONS)"
57 cabal repl --enable-benchmarks $(project)-benchmark
58 benchmarks/prof-time: $(project)-benchmark.eventlog.json
59 benchmarks/prof-heap: $(project)-benchmark.eventlog.html
60 .PHONY: $(project)-benchmark.eventlog
61 $(project)-benchmark.eventlog $(project)-benchmark.prof:
62 cabal bench $(CABAL_BENCH_FLAGS) \
63 --benchmark-options "$(BENCHMARK_OPTIONS) +RTS $(RTS_OPTIONS)" \
64 --enable-profiling $(GHC_PROF_OPTIONS)
65 $(project)-benchmark.prof2:
66 cabal v2-build lib:$(project) --enable-profiling $(GHC_PROF_OPTIONS) --write-ghc-environment-files=always
67 cabal bench $(CABAL_BENCH_FLAGS) \
68 --benchmark-options "$(BENCHMARK_OPTIONS)" \
69 --enable-profiling $(GHC_PROF_OPTIONS) \
70 --ghc-options "$(addprefix -opti,+RTS $(RTS_OPTIONS))"
73 cabal haddock --haddock-css ocean --haddock-hyperlink-source
76 git tag --merged | grep -Fqx "$(package)-$(version)" || \
77 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
81 cabal haddock --haddock-for-hackage --enable-doc
84 cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz
85 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz
86 %/publish: CABAL_UPLOAD_FLAGS+=--publish
89 publish: upload/publish
94 nix flake update --recreate-lock-file
96 nix -L develop --command cabal repl