]> rtime.felk.cvut.cz Git - omk.git/blob - doc/Makefile
Bitmap figures included in HTML documentation.
[omk.git] / doc / Makefile
1 SOURCE = omk-manual
2
3 all: $(SOURCE).pdf $(SOURCE).txt $(SOURCE).html
4
5 PNG_FIGS = $(wildcard *.png)
6 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
7
8 %.pdf: %.png
9         convert $< -density 150 $@
10
11 %.pdf: %.texinfo $(PDF_FIGS)
12         texi2dvi --pdf $<
13         texi2dvi --pdf $<
14
15 %.txt: %.texinfo
16         makeinfo --no-headers --force -o $@ $<
17
18 %.html: %.texinfo Makefile
19         texi2html --l2h $<
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
25         mv $@.tmp $@
26
27 clean:
28         rm -f $(SOURCE).{aux,cp,cps,fn,ky,log,pg,toc,tp,vr,vrs} $(PDF_FIGS)