]> rtime.felk.cvut.cz Git - omk.git/blob - doc/Makefile
Makeinfo is now used to produce html manual.
[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
19         makeinfo --html --no-split $< -o $@
20 #       texi2html --l2h $<
21 # Fix texinfo HTML output
22 #       perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
23 #                  -e 'if (!$$toc) { s/class="toc"//}' \
24 #                  -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
25 #                  -e 'print;' < $@ > $@.tmp
26 #       mv $@.tmp $@
27
28 clean:
29         rm -f $(SOURCE).{aux,cp,cps,fn,ky,log,pg,toc,tp,vr,vrs} $(PDF_FIGS)
30
31 WWW ?= www
32
33 web: $(WWW) $(addprefix $(WWW)/,index.html $(SOURCE).html $(wildcard *.png) $(SOURCE).pdf)
34
35 $(WWW):
36         mkdir $@
37
38 $(WWW)/index.html: index.html
39         sed -e "s/<!-- @LAST_MODIFIED@ -->/`LC_TIME=C TZ= date`/" < $< > $@
40
41 $(WWW)/%: %
42         cp -p $^ $@