2 VERSION:=$(shell git describe|sed -e 's/^v//')
6 all: $(SOURCE).pdf $(SOURCE).txt $(SOURCE).html
9 echo $(VERSION) | cmp -s $@ - || echo $(VERSION) > $@
11 %.texi: %.texinfo .version
12 sed -e 's/\$$Id\$$/$(VERSION)/g' < $< > $@
14 PNG_FIGS = $(wildcard *.png)
15 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
18 convert $< -density 150 $@
20 %.pdf: %.texi $(PDF_FIGS)
25 makeinfo --no-headers --force -o $@ $<
28 makeinfo --html --no-split -o $@ $<
30 # Fix texinfo HTML output
31 # perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
32 # -e 'if (!$$toc) { s/class="toc"//}' \
33 # -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
34 # -e 'print;' < $@ > $@.tmp
38 rm -f $(SOURCE).{aux,cp,cps,fn,ky,log,pg,toc,tp,vr,vrs} $(PDF_FIGS) .version
42 web: all $(WWW) $(addprefix $(WWW)/,index.html $(SOURCE).html $(wildcard *.png) $(SOURCE).pdf)
47 $(WWW)/index.html: index.html
48 sed -e "s/<!-- @LAST_MODIFIED@ -->/`LC_TIME=C TZ= date`/" < $< > $@