X-Git-Url: https://git.sourcephile.fr/haskell/symantic.git/blobdiff_plain/a745f15054723d390d3a4ad0180601416694855d..e4ce77687c78b15f52a328be9914963fe87852f7:/GNUmakefile diff --git a/GNUmakefile b/GNUmakefile index cfa8cce..b23110d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,4 +1,5 @@ PKGS := symantic-grammar symantic-document symantic symantic-lib +HS := $(shell find $(PKGS) -name '*.hs') all: build @@ -20,10 +21,28 @@ cleaner: $(PKGS:=/cleaner) cd $*; stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS) %/fast: override STACK_BUILD_FLAGS+=--fast +%/fast: override STACK_HADDOCK_FLAGS+=--fast %/fast: override STACK_TEST_FLAGS+=--fast %/fast: % +doc: $(PKGS:=/doc) +%/doc: + cd $*; stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS) + +HLint.hs: $(HS) + sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs + echo '-- BEGIN: generated hints' >> HLint.hs + hlint $(foreach p,$(PKGS),--find $p) | grep '^'infix | sort -u >> HLint.hs + echo '-- END: generated hints' >> HLint.hs + +lint: $(PKGS:=/lint) $(HS) +%/lint: HLint.hs + cd $*; if hlint --quiet --report=hlint.html -XNoCPP \ + $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$*) $(HLINT_FLAGS) .; \ + then rm -f hlint.html; \ + else sensible-browser hlint.html & fi + tag: $(PKGS:=/tag) %/tag: cabal=$*/$*.cabal; \ @@ -32,6 +51,11 @@ tag: $(PKGS:=/tag) git tag --merged | grep -Fqx "$$name-$$version" || \ git tag -f -s -m "$$name v$$version" $$name-$$version +upload: $(PKGS:=/upload) +%/upload: + cd $*; LANG=C stack $(STACK_FLAGS) sdist --sign + cd $*; LANG=C stack $(STACK_FLAGS) upload . + .PHONY: stats stats: gitstats . $@