Makefile
changeset 18 5ec46ef9fd4b
parent 16 47972dce0be0
child 22 6c2ec23b8f47
--- a/Makefile	Tue Apr 21 22:15:22 2015 +0200
+++ b/Makefile	Wed Apr 22 07:41:45 2015 +0200
@@ -1,27 +1,38 @@
-TXT = short.txt
-HTML = out/short.html
-PDF = out/short.pdf
+TXT  = short.txt	# INPUT
 
-#REVISION = ${shell hg id -tibB}
-REVISION = ${shell hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'}
+HTML = out/short.html	# OUTPUT
+PDF  = out/short.pdf	# OUTPUT
+
 DATE = ${shell date -I}
 
+ifeq (${wildcard .hg_archival.txt}, .hg_archival.txt)
+    REVISION = ${shell grep ^latesttag: .hg_archival.txt|cut -f2 -d' '}
+else
+    REVISION = ${shell hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'}
+endif
+
+# Flags for asciidoc
 AOPTS = -a revision="${REVISION}" -a date="${DATE}"
 
 .PHONY:	all clean pdf html
 
 
 all:	html pdf 
-clean:	; rm -f ${HTML} ${PDF}
+clean:	
+distclean:	clean; rm -r out
 
 pdf:	${PDF}
 html:	${HTML}
 
 out/%.pdf:		%.txt $(MAKEFILE_LIST) short.conf
 		@mkdir -p ${dir $@}
-		a2x -k --asciidoc-opts="${AOPTS}" -D ${dir $@} $<
+		a2x --asciidoc-opts="${AOPTS}" -D ${dir $@} $<
 
 out/%.html:		%.txt $(MAKEFILE_LIST) short.conf
 		@mkdir -p ${dir $@}
-#		asciidoc -a revision="${REVISION}" -a date="${DATE}" -o $@ $<
 		asciidoc ${AOPTS} -o $@ $<
+
+publish:	all
+		cd out \
+		&& /bin/echo -e 'progress\nput *' \
+		| sftp -b - 'www.schlittermann.de@www.schlittermann.de:htdocs/doc/Exim_(de)/'