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,')
25 echo 'WVSTART() { local d=$(CURDIR)/$(DIR)/$$(echo $$1|tr " " -|tr A-Z a-z); mkdir -p $$d && cd $$d; }; WVPASS() { :; }; needs_valid_CC() { :; }; omkize() { :; }' > $(DIR)/wvtest.sh
26 cd $(DIR) && ../../../$(DIR)
29 convert $< -density 150 $@
31 # We want to use synctex. texi2dvi does not support this directly, so
32 # we use the PDFTEX variable for this.
33 export PDFTEX = pdfetex -synctex=1
35 %.pdf: %.texinfo $(PNG_FIGS) $(MANUAL_INCLUDES)
39 %.txt: %.texinfo $(MANUAL_INCLUDES)
40 makeinfo --no-headers --force -o $@ $<
42 %.html: %.texinfo $(MANUAL_INCLUDES)
43 makeinfo --html --no-split -o $@ $<
45 # Fix texinfo HTML output
46 # perl -w -n -e 'if (/<div class="contents">/) {$$toc=1}' \
47 # -e 'if (!$$toc) { s/class="toc"//}' \
48 # -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<img src="$$1.png"><\/img>/ }' \
49 # -e 'print;' < $@ > $@.tmp
53 rm -f $(addprefix omk-manual.,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version
57 web: all $(WWW) $(addprefix $(WWW)/,index.html omk-manual.html $(wildcard *.png) omk-manual.pdf $(wildcard RelNotes*.txt))
62 $(WWW)/index.html: index.html
63 sed -e "s/<!-- @LAST_MODIFIED@ -->/`LC_TIME=C TZ= date`/" < $< > $@