VERSION:=$(shell git describe|sed -e 's/^v//') OLDVERSION:=$(shell cat .version 2>/dev/null) .PHONY: FORCE all: omk-manual.txt omk-manual.html omk-manual.pdf ifneq ($(VERSION),$(OLDVERSION)) .version: FORCE echo $(VERSION) | cmp -s $@ - || echo $(VERSION) > $@ endif PNG_FIGS = $(wildcard *.png) PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS)) %.pdf: %.png convert $< -density 150 $@ %.pdf: %.texinfo $(PNG_FIGS) .version texi2dvi --pdf $< texi2dvi --pdf $< %.txt: %.texinfo .version makeinfo --no-headers --force -o $@ $< %.html: %.texinfo .version makeinfo --html --no-split -o $@ $< # texi2html --l2h $< # Fix texinfo HTML output # perl -w -n -e 'if (/
/) {$$toc=1}' \ # -e 'if (!$$toc) { s/class="toc"//}' \ # -e '@match=/\[ ([^ ]+) \]/; if (@match > 0 && -r $$match[0] . ".png") { s/\[ ([^ ]+) \]/<\/img>/ }' \ # -e 'print;' < $@ > $@.tmp # mv $@.tmp $@ clean: rm -f $(addprefix omk-manual.,aux cp cps fn ky log pg toc tp vr vrs) $(PDF_FIGS) .version WWW ?= www web: all $(WWW) $(addprefix $(WWW)/,index.html omk-manual.html $(wildcard *.png) omk-manual.pdf $(wildcard RelNotes*.txt)) $(WWW): mkdir $@ $(WWW)/index.html: index.html sed -e "s//`LC_TIME=C TZ= date`/" < $< > $@ $(WWW)/%: % cp -p $^ $@