wip
[haskell/symantic-parser.git] / Makefile
index cc76638cd72027c45b9fe44596ecc0d041c2103c..2b67af0487302a23de0be320ea1ec98ed6fcd336 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 override BENCHMARK_OPTIONS += --output benchmarks/html/$(version).html --match glob $b
-override GHCID_OPTIONS += --no-height-limit --reverse-errors 
+override GHCID_OPTIONS += --no-height-limit --reverse-errors
 override GHC_PROF_OPTIONS += -eventlog -fprof-auto -fprof-cafs
 #-fprof-auto-calls
 override REPL_OPTIONS += -ignore-dot-ghci
@@ -95,9 +95,20 @@ $(project)-benchmark.prof2:
 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)
+.PHONY: ChangeLog.md
+ChangeLog.md:
+       ! git tag --merged | grep -Fqx $(package)-$(version)
+       git diff --exit-code
+       git tag -f $(package)-$(version)
+       git-chglog --output $@.new --tag-filter-pattern '$(package)-.*' $(package)-$(version)
+       touch $@
+       cat $@ >>$@.new
+       mv -f $@.new $@
+       git tag -d $(package)-$(version)
+       git add '$@'
+       git commit -m 'doc: update `$@`'
+tag: ChangeLog.md
+       git tag -s -m $(package)-$(version) $(package)-$(version)
 
 tar:
        git diff --exit-code
@@ -114,11 +125,12 @@ upload: tar tag
        
 publish: upload/publish
 
-nix-build:
-       nix -L build
-nix-relock:
-       nix flake update --recreate-lock-file
-nix-repl:
-       nix -L develop --command cabal repl $(CABAL_REPL_FLAGS)
-nix-shell:
-       nix -L develop
+.hlint.yaml: $(shell find src -name '*.hs' -not -name 'HLint.hs')
+       sed -i -e '/^# BEGIN: generated hints/,/^# END: generated hints/d' $@
+       echo >>$@ '# BEGIN: generated hints'
+       hlint --find . | grep -- '- fixity:' | sort -u >>$@
+       echo >>$@ '# END: generated hints'
+lint: .hlint.yaml
+       if hlint --quiet --report=hlint.html -XNoCPP $(HLINT_FLAGS) .; \
+       then rm -f hlint.html; \
+       else sensible-browser ./hlint.html & fi