hgbook

diff en/Makefile @ 177:c54f4c106fd5

Record the version of Mercurial used.
author Bryan O'Sullivan <bos@serpentine.com>
date Wed Mar 28 23:01:57 2007 -0700 (2007-03-28)
parents 5f305adeb584
children 5fc4a45c069f
line diff
     1.1 --- a/en/Makefile	Tue Mar 27 15:04:47 2007 -0700
     1.2 +++ b/en/Makefile	Wed Mar 28 23:01:57 2007 -0700
     1.3 @@ -1,7 +1,5 @@
     1.4  # This makefile requires GNU make.
     1.5  
     1.6 -hg_id := $(shell hg parents --template '{node|short}\n')
     1.7 -
     1.8  sources := \
     1.9  	00book.tex \
    1.10  	99book.bib \
    1.11 @@ -12,6 +10,7 @@
    1.12  	concepts.tex \
    1.13  	daily.tex \
    1.14  	filenames.tex \
    1.15 +	hg_id.tex \
    1.16  	hook.tex \
    1.17  	intro.tex \
    1.18  	mq.tex \
    1.19 @@ -91,6 +90,13 @@
    1.20  	-output-directory $(dir $(1)) \
    1.21  	-jobname $(basename $(notdir $(1)))
    1.22  
    1.23 +hg = $(shell which hg)
    1.24 +
    1.25 +hg-id = $(shell hg parents --template '{node|short}\n')
    1.26 +
    1.27 +hg-version = $(shell hg version -q | \
    1.28 +		     sed 's,.*(version \(unknown\|[a-f0-9]*\)),\1,')
    1.29 +
    1.30  all: pdf html
    1.31  
    1.32  pdf: pdf/hgbook.pdf
    1.33 @@ -173,7 +179,10 @@
    1.34  	cd examples && ./run-example $(notdir $<)
    1.35  
    1.36  build_id.tex: $(wildcard ../.hg/00changelog.[id])
    1.37 -	echo -n $(hg_id) > build_id.tex
    1.38 +	echo -n $(hg-id) > build_id.tex
    1.39 +
    1.40 +hg_id.tex: $(hg)
    1.41 +	echo -n $(hg-version) > hg_id.tex
    1.42  
    1.43  clean:
    1.44  	rm -rf dist html pdf \
    1.45 @@ -181,7 +190,7 @@
    1.46  		$(image-dot:%.dot=%.png) \
    1.47  		$(image-svg:%.svg=%.pdf) \
    1.48  		$(image-svg:%.svg=%.png) \
    1.49 -		examples/*.{lxo,run} examples/.run build_id.tex
    1.50 +		examples/*.{lxo,run} examples/.run build_id.tex hg_id.tex
    1.51  
    1.52  install: pdf split $(dist-sources)
    1.53  	rm -rf dist