]> Git — Sourcephile - haskell/symantic-base.git/blob - Makefile
build: remove lingering Stack file
[haskell/symantic-base.git] / Makefile
1 override REPL_OPTIONS += -ignore-dot-ghci
2 override GHCID_OPTIONS += --no-height-limit --reverse-errors
3
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
9 all: build
10 build:
11 cabal build $(CABAL_BUILD_FLAGS)
12 clean c:
13 cabal clean
14 repl:
15 cabal repl $(CABAL_REPL_FLAGS) $(project)
16 ghcid:
17 ghcid $(GHCID_OPTIONS) -c 'cabal repl $(CABAL_REPL_FLAGS) $(project) $(addprefix --repl-options ,$(REPL_OPTIONS))'
18
19 doc:
20 cabal haddock --haddock-css ocean --haddock-hyperlink-source
21
22 tag:
23 git tag --merged | grep -Fqx "$(package)-$(version)" || \
24 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
25
26 tar:
27 git diff --exit-code
28 reuse lint
29 cabal sdist
30 cabal haddock --haddock-for-hackage --enable-doc
31 upload: LANG=C
32 upload: tar tag
33 git push --follow-tags $(GIT_PUSH_FLAGS)
34 cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz
35 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz
36 %/publish: CABAL_UPLOAD_FLAGS+=--publish
37 %/publish: %
38
39 publish: upload/publish
40
41 nix-build:
42 nix -L build
43 nix-relock:
44 nix flake update --recreate-lock-file
45 nix-repl:
46 nix -L develop --command cabal repl $(CABAL_REPL_FLAGS)
47 nix-shell:
48 nix -L develop