Makefile
changeset 18 5ec46ef9fd4b
parent 16 47972dce0be0
child 22 6c2ec23b8f47
equal deleted inserted replaced
17:763647471039 18:5ec46ef9fd4b
     1 TXT = short.txt
     1 TXT  = short.txt	# INPUT
     2 HTML = out/short.html
       
     3 PDF = out/short.pdf
       
     4 
     2 
     5 #REVISION = ${shell hg id -tibB}
     3 HTML = out/short.html	# OUTPUT
     6 REVISION = ${shell hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'}
     4 PDF  = out/short.pdf	# OUTPUT
       
     5 
     7 DATE = ${shell date -I}
     6 DATE = ${shell date -I}
     8 
     7 
       
     8 ifeq (${wildcard .hg_archival.txt}, .hg_archival.txt)
       
     9     REVISION = ${shell grep ^latesttag: .hg_archival.txt|cut -f2 -d' '}
       
    10 else
       
    11     REVISION = ${shell hg log -r . --template '{latesttag}-{latesttagdistance}-{node|short}'}
       
    12 endif
       
    13 
       
    14 # Flags for asciidoc
     9 AOPTS = -a revision="${REVISION}" -a date="${DATE}"
    15 AOPTS = -a revision="${REVISION}" -a date="${DATE}"
    10 
    16 
    11 .PHONY:	all clean pdf html
    17 .PHONY:	all clean pdf html
    12 
    18 
    13 
    19 
    14 all:	html pdf 
    20 all:	html pdf 
    15 clean:	; rm -f ${HTML} ${PDF}
    21 clean:	
       
    22 distclean:	clean; rm -r out
    16 
    23 
    17 pdf:	${PDF}
    24 pdf:	${PDF}
    18 html:	${HTML}
    25 html:	${HTML}
    19 
    26 
    20 out/%.pdf:		%.txt $(MAKEFILE_LIST) short.conf
    27 out/%.pdf:		%.txt $(MAKEFILE_LIST) short.conf
    21 		@mkdir -p ${dir $@}
    28 		@mkdir -p ${dir $@}
    22 		a2x -k --asciidoc-opts="${AOPTS}" -D ${dir $@} $<
    29 		a2x --asciidoc-opts="${AOPTS}" -D ${dir $@} $<
    23 
    30 
    24 out/%.html:		%.txt $(MAKEFILE_LIST) short.conf
    31 out/%.html:		%.txt $(MAKEFILE_LIST) short.conf
    25 		@mkdir -p ${dir $@}
    32 		@mkdir -p ${dir $@}
    26 #		asciidoc -a revision="${REVISION}" -a date="${DATE}" -o $@ $<
       
    27 		asciidoc ${AOPTS} -o $@ $<
    33 		asciidoc ${AOPTS} -o $@ $<
       
    34 
       
    35 publish:	all
       
    36 		cd out \
       
    37 		&& /bin/echo -e 'progress\nput *' \
       
    38 		| sftp -b - 'www.schlittermann.de@www.schlittermann.de:htdocs/doc/Exim_(de)/'