change license to AGPL-3.0-or-later
[haskell/symantic-parser.git] / Makefile
index 1c97c39c621045d0f259015b4b6f7d8b46a7a0dd..8369082c2c3832cf05a2c02ed9c70e61b70a0ccc 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,49 @@
+cabal = $(wildcard *.cabal)
+package = $(notdir ./$(cabal:.cabal=))
+version = $(shell sed -ne 's/^version: *\(.*\)/\1/p' $(cabal))
+all: build
+build:
+       cabal build
+clean c:
+       cabal clean
 repl:
        cabal repl
 
 t:
-       cabal test --enable-profiling --enable-library-coverage --enable-coverage --test-show-details always
+       cabal test -fdump-splices --test-show-details always --test-options "--color always --size-cutoff 100000"
 t/accept:
-       cabal test --test-show-details always --test-options --accept
+       cabal test --test-show-details always --test-options "--accept --color always --size-cutoff 100000"
+t/prof:
+       cabal test --enable-profiling --enable-library-coverage --enable-coverage --test-show-details always
+t/repl:
+       cabal repl --enable-tests symantic-parser-test
+t/splices: t
+       shopt -s globstar; $$EDITOR dist-newstyle/build/**/t/**/*.dump-splices
 
 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