1 PKGS := symantic-grammar symantic-document symantic symantic-lib
2 HS := $(shell find $(PKGS) -name '*.hs')
8 cd $*; stack $(STACK_FLAGS) build $(STACK_BUILD_FLAGS)
9 .PHONY: $(PKGS) $(foreach p,$(PKGS),$(eval $p: $p/build))
13 ! grep -q '^Test-Suite\>' $*/$*.cabal || \
14 { cd $*; stack $(STACK_FLAGS) test $(STACK_TEST_FLAGS); }
16 clean: $(PKGS:=/clean)
17 cleaner: $(PKGS:=/cleaner)
19 cd $*; stack $(STACK_FLAGS) clean $(STACK_CLEAN_FLAGS)
21 cd $*; stack $(STACK_FLAGS) clean --full $(STACK_CLEAN_FLAGS)
23 %/fast: override STACK_BUILD_FLAGS+=--fast
24 %/fast: override STACK_HADDOCK_FLAGS+=--fast
25 %/fast: override STACK_TEST_FLAGS+=--fast
31 cd $*; stack $(STACK_FLAGS) haddock $(STACK_HADDOCK_FLAGS)
33 markdown $*.md >$*.html
35 sensible-browser $*.html
38 sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
39 echo '-- BEGIN: generated hints' >> HLint.hs
40 hlint $(foreach p,$(PKGS),--find $p) | grep '^'infix | sort -u >> HLint.hs
41 echo '-- END: generated hints' >> HLint.hs
43 lint: $(PKGS:=/lint) $(HS)
45 cd $*; if hlint --quiet --report=hlint.html -XNoCPP \
46 $(shell cabal-cargs --format=ghc --only=default_extensions --sourcefile=$*) $(HLINT_FLAGS) .; \
47 then rm -f hlint.html; \
48 else sensible-browser hlint.html & fi
53 name=$$(sed -ne 's/^name: *\(.*\)/\1/p' "$$cabal"); \
54 version=$$(sed -ne 's/^version: *\(.*\)/\1/p' "$$cabal"); \
55 git tag --merged | grep -Fqx "$$name-$$version" || \
56 git tag -f -s -m "$$name v$$version" $$name-$$version
58 upload: $(PKGS:=/upload)
60 cd $*; LANG=C stack $(STACK_FLAGS) sdist --sign
61 cd $*; LANG=C stack $(STACK_FLAGS) upload .
67 sensible-browser stats/index.html