]> Git — Sourcephile - haskell/symantic-base.git/blob - Makefile
harmonize deriving and module names
[haskell/symantic-base.git] / Makefile
1 override REPL_OPTIONS += -ignore-dot-ghci
2
3 cabal := $(wildcard *.cabal)
4 package := $(notdir ./$(cabal:.cabal=))
5 version := $(shell sed -ne 's/^version: *\(.*\)/\1/p' $(cabal))
6 project := $(patsubst %.cabal,%,$(cabal))
7
8 all: build
9 build:
10 cabal build $(CABAL_BUILD_FLAGS)
11 clean c:
12 cabal clean
13 repl:
14 cabal repl $(CABAL_REPL_FLAGS) $(project)
15 ghcid:
16 ghcid -c 'cabal repl $(CABAL_REPL_FLAGS) $(project) --repl-options "$(REPL_OPTIONS)"' --reverse-errors
17
18 doc:
19 cabal haddock --haddock-css ocean --haddock-hyperlink-source
20
21 tag:
22 git tag --merged | grep -Fqx "$(package)-$(version)" || \
23 git tag -f -s -m "$(package) v$(version)" $(package)-$(version)
24
25 tar:
26 cabal sdist
27 cabal haddock --haddock-for-hackage --enable-doc
28 upload: LANG=C
29 upload: tar
30 cabal upload $(CABAL_UPLOAD_FLAGS) dist-newstyle/sdist/$(package)-$(version).tar.gz
31 cabal upload $(CABAL_UPLOAD_FLAGS) --documentation dist-newstyle/$(package)-$(version)-docs.tar.gz
32 %/publish: CABAL_UPLOAD_FLAGS+=--publish
33 %/publish: %
34
35 publish: upload/publish
36
37 nix-build:
38 nix -L build
39 nix-relock:
40 nix flake update --recreate-lock-file
41 nix-repl:
42 nix -L develop --command cabal repl $(CABAL_REPL_FLAGS)
43 nix-shell:
44 nix -L develop