3 all: $(SOURCE).pdf $(SOURCE).txt $(SOURCE).html
5 PNG_FIGS = $(wildcard *.png)
6 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
9 convert $< -density 150 $@
11 %.pdf: %.texinfo $(PDF_FIGS)
16 makeinfo --no-headers --force -o $@ $<
18 %.html: %.texinfo Makefile
20 # Fix texinfo HTML output
21 perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
22 -e 'if (!$$toc) { s/class="toc"//}' \
23 -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
24 -e 'print;' < $@ > $@.tmp
28 rm -f $(SOURCE).{aux,cp,cps,fn,ky,log,pg,toc,tp,vr,vrs} $(PDF_FIGS)