1 VERSION:=$(shell git describe|sed -e 's/^v//')
2 OLDVERSION:=$(shell cat .version 2>/dev/null)
6 all: omk-manual.txt omk-manual.html omk-manual.pdf
8 ifneq ($(VERSION),$(OLDVERSION))
10 echo $(VERSION) | cmp -s $@ - || echo $(VERSION) > $@
13 PNG_FIGS = $(wildcard *.png)
14 PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS))
16 MANUAL_INCLUDES = .version tests/programs/Makefile.omk \
17 tests/libraries/Makefile.omk tests/default-config/Makefile.omk \
18 tests/default-config/subdir/Makefile.omk \
19 tests/default-config/config.omk-correct
21 tests/%: DIR=$(shell echo $@|sed -e 's,\([^/]*/[^/]*\)/.*,\1,')
26 sh ../../../$(DIR).files
29 convert $< -density 150 $@
31 %.pdf: %.texinfo $(PNG_FIGS) $(MANUAL_INCLUDES)
35 %.txt: %.texinfo $(MANUAL_INCLUDES)
36 makeinfo --no-headers --force -o $@ $<
38 %.html: %.texinfo $(MANUAL_INCLUDES)
39 makeinfo --html --no-split -o $@ $<
41 # Fix texinfo HTML output
42 # perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
43 # -e 'if (!$$toc) { s/class="toc"//}' \
44 # -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
45 # -e 'print;' < $@ > $@.tmp
49 rm -f $(addprefix omk-manual.,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version
53 web: all $(WWW) $(addprefix $(WWW)/,index.html omk-manual.html $(wildcard *.png) omk-manual.pdf $(wildcard RelNotes*.txt))
58 $(WWW)/index.html: index.html
59 sed -e "s/<!-- @LAST_MODIFIED@ -->/`LC_TIME=C TZ= date`/" < $< > $@