override RTS_OPTIONS += -L100 override TEST_OPTIONS += --color always $(addprefix -p ,$t) override GHC_PROF_OPTIONS += -fprof-auto -fprof-auto-calls override REPL_OPTIONS += -ignore-dot-ghci cabal := $(wildcard *.cabal) package := $(notdir ./$(cabal:.cabal=)) version := $(shell sed -ne 's/^version: *\(.*\)/\1/p' $(cabal)) project := $(patsubst %.cabal,%,$(cabal)) all: build build: cabal build clean c: cabal clean repl: cabal repl $(project) ghcid: ghcid -c 'cabal repl $(project) --repl-options "$(REPL_OPTIONS)"' --reverse-errors .PHONY: tests t tests: cabal test $(CABAL_TEST_FLAGS) \ --test-show-details always --test-options "$(TEST_OPTIONS)" tests/prof-time: $(project)-tests.eventlog.json tests/prof-heap: $(project)-tests.eventlog.html .PHONY: $(project)-tests.eventlog $(project)-tests.eventlog $(project)-tests.prof: cabal test $(CABAL_TEST_FLAGS) \ --test-show-details always --test-options "$(TEST_OPTIONS) +RTS $(RTS_OPTIONS)" \ --enable-profiling $(GHC_PROF_OPTIONS) || true tests/repl: cabal repl --enable-tests $(project)-tests %/accept: TEST_OPTIONS += --accept %/accept: % %/cover: CABAL_TEST_FLAGS += --enable-coverage %/cover: % doc: cabal haddock --haddock-css ocean --haddock-hyperlink-source tag: git tag --merged | grep -Fqx "$(package)-$(version)" || \ git tag -f -s -m "$(package) v$(version)" $(package)-$(version) tar: cabal sdist cabal haddock --haddock-for-hackage --enable-doc upload: LANG=C upload: tar cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz %/publish: CABAL_UPLOAD_FLAGS+=--publish %/publish: % publish: upload/publish nix-build: nix -L build nix-relock: nix flake update --recreate-lock-file nix-repl: nix -L develop --command cabal repl nix-shell: nix -L develop