X-Git-Url: http://git.cielonegro.org/gitweb.cgi?p=time-w3c.git;a=blobdiff_plain;f=cabal-package.mk;h=41cbbd288c377c85f406dde8c1f8fe06321c6a54;hp=d8bbaad16ee155ad694cb2b90652a37fdb10636e;hb=e47a0e977d38a22a34606ee204d8133ef3404acb;hpb=0734f066378beb86c276196367c8716faec9b45c diff --git a/cabal-package.mk b/cabal-package.mk index d8bbaad..41cbbd2 100644 --- a/cabal-package.mk +++ b/cabal-package.mk @@ -14,11 +14,14 @@ RM_RF ?= rm -rf SUDO ?= sudo AUTOCONF ?= autoconf HLINT ?= hlint +HPC ?= hpc +DITZ ?= ditz CONFIGURE_ARGS ?= --disable-optimization SETUP_FILE := $(wildcard Setup.*hs) CABAL_FILE := $(wildcard *.cabal) +PKG_NAME := $(CABAL_FILE:.cabal=) ifeq ($(shell ls configure.ac 2>/dev/null),configure.ac) AUTOCONF_AC_FILE := configure.ac @@ -40,6 +43,7 @@ all: build build: setup-config build-hook ./Setup build + $(RM_RF) *.tix build-hook: @@ -70,7 +74,7 @@ Setup: $(SETUP_FILE) $(GHC) --make Setup clean: clean-hook - $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo + $(RM_RF) dist Setup *.o *.hi .setup-config *.buildinfo *.tix .hpc $(FIND) . -name '*~' -exec rm -f {} \; clean-hook: @@ -85,11 +89,43 @@ sdist: setup-config ./Setup sdist test: build + $(RM_RF) dist/test ./Setup test + if ls *.tix >/dev/null 2>&1; then \ + $(HPC) sum --output="merged.tix" --union --exclude=Main *.tix; \ + $(HPC) markup --destdir="dist/hpc" --fun-entry-count "merged.tix"; \ + fi + +ditz: + $(DITZ) html dist/ditz + +fixme: + @$(FIND) . \ + \( -name 'dist' -or -name '.git' -or -name '_darcs' \) -prune \ + -or \ + \( -name '*.c' -or -name '*.h' -or \ + -name '*.hs' -or -name '*.lhs' -or \ + -name '*.hsc' -or -name '*.cabal' \) \ + -exec egrep -i '(fixme|thinkme)' {} \+ \ + || echo 'No FIXME or THINKME found.' lint: - $(HLINT) . --report \ - --ignore="Use string literal" \ - --ignore="Use concatMap" - -.PHONY: build build-hook setup-config setup-config-hook run clean clean-hook install doc sdist test lint + $(HLINT) . --report +# $(HLINT) . --report \ +# --ignore="Use string literal" \ +# --ignore="Use concatMap" + +push: doc ditz + if [ -d "_darcs" ]; then \ + darcs push; \ + elif [ -d ".git" ]; then \ + git push --all && git push --tags; \ + fi + rsync -av --delete \ + dist/doc/html/$(PKG_NAME)/ \ + www@nem.cielonegro.org:static.cielonegro.org/htdocs/doc/$(PKG_NAME) + rsync -av --delete \ + dist/ditz/ \ + www@nem.cielonegro.org:static.cielonegro.org/htdocs/ditz/$(PKG_NAME) + +.PHONY: build build-hook setup-config setup-config-hook run clean clean-hook install doc sdist test lint push