]> rtime.felk.cvut.cz Git - omk.git/blob - doc/Makefile
doc: Change how is the version number included
[omk.git] / doc / Makefile
1 SOURCE = omk-manual
2 VERSION:=$(shell git describe|sed -e 's/^v//')
3
4 .PHONY: FORCE
5
6 all: $(SOURCE).txt $(SOURCE).html $(SOURCE).pdf
7
8 .version: FORCE
9         echo $(VERSION) | cmp -s $@ - || echo $(VERSION) > $@
10
11 %.texinfo: .version
12
13 PNG_FIGS = $(wildcard *.png)
14 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
15
16 %.pdf: %.png
17         convert $< -density 150 $@
18
19 %.pdf: %.texinfo $(PDF_FIGS)
20         texi2dvi --pdf $<
21         texi2dvi --pdf $<
22
23 %.txt: %.texinfo
24         makeinfo --no-headers --force -o $@ $<
25
26 %.html: %.texinfo
27         makeinfo --html --no-split -o $@ $<
28 #       texi2html --l2h $<
29 # Fix texinfo HTML output
30 #       perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
31 #                  -e 'if (!$$toc) { s/class="toc"//}' \
32 #                  -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
33 #                  -e 'print;' < $@ > $@.tmp
34 #       mv $@.tmp $@
35
36 clean:
37         rm -f $(addprefix $(SOURCE).,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version
38
39 WWW ?= www
40
41 web: all $(WWW) $(addprefix $(WWW)/,index.html $(SOURCE).html $(wildcard *.png) $(SOURCE).pdf $(wildcard RelNotes*.txt))
42
43 $(WWW):
44         mkdir $@
45
46 $(WWW)/index.html: index.html
47         sed -e "s/<!-- @LAST_MODIFIED@ -->/`LC_TIME=C TZ= date`/" < $< > $@
48
49 $(WWW)/%: %
50         cp -p $^ $@