]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - cabal-package.mk
DefaultExtensionMap is now generated with TH.
[Lucu.git] / cabal-package.mk
index 2363b98c6d4f6d38725bc0352c8cf6de2a08b9cf..cc534f4648d16242d8d4f33147d30acee9b61f7d 100644 (file)
@@ -18,6 +18,7 @@ HPC      ?= hpc
 DITZ     ?= ditz
 
 CONFIGURE_ARGS ?= --disable-optimization
+HLINT_OPTS     ?= --cross --report=dist/report.html
 
 SETUP_FILE := $(wildcard Setup.*hs)
 CABAL_FILE := $(wildcard *.cabal)
@@ -99,6 +100,13 @@ test: build
 ditz:
        $(DITZ) html dist/ditz
 
+ChangeLog:
+       rm -f $@
+       $(DITZ) releases | awk '{print $$1}' | sort --reverse | while read i; do \
+               $(DITZ) changelog $$i >> $@; \
+       done
+       head $@
+
 fixme:
        @$(FIND) . \
                \( -name 'dist' -or -name '.git' -or -name '_darcs' \) -prune \
@@ -106,25 +114,33 @@ fixme:
                \( -name '*.c'   -or -name '*.h'   -or \
                   -name '*.hs'  -or -name '*.lhs' -or \
                   -name '*.hsc' -or -name '*.cabal' \) \
-               -exec egrep -i '(fixme|thinkme)' {} \+ \
+               -exec egrep 'FIXME|THINKME|TODO' {} \+ \
                || echo 'No FIXME or THINKME found.'
 
 lint:
-       $(HLINT) . --report
+       $(HLINT) . $(HLINT_OPTS)
+
+push: push-repo push-ditz push-doc
 
-push: doc ditz
+push-repo:
        if [ -d "_darcs" ]; then \
                darcs push; \
        elif [ -d ".git" ]; then \
                git push --all && git push --tags; \
        fi
+
+push-ditz: ditz
+       rsync -av --delete \
+               dist/ditz/ \
+               www@nem.cielonegro.org:static.cielonegro.org/htdocs/ditz/$(PKG_NAME)
+
+push-doc: doc
        if [ -d "dist/doc" ]; then \
                rsync -av --delete \
                        dist/doc/html/$(PKG_NAME)/ \
                        www@nem.cielonegro.org:static.cielonegro.org/htdocs/doc/$(PKG_NAME); \
        fi
-       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
+.PHONY: build build-hook setup-config setup-config-hook run clean clean-hook \
+               install doc sdist test lint push push-repo push-ditz push-doc \
+               ChangeLog