SOURCE = omk-manual all: $(SOURCE).pdf $(SOURCE).txt $(SOURCE).html PNG_FIGS = $(wildcard *.png) PDF_FIGS = $(patsubst %.png,%.pdf,$(PNG_FIGS)) %.pdf: %.png convert $< -density 150 $@ %.pdf: %.texinfo $(PDF_FIGS) texi2dvi --pdf $< texi2dvi --pdf $< %.txt: %.texinfo makeinfo --no-headers --force -o $@ $< %.html: %.texinfo 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 $(SOURCE).{aux,cp,cps,fn,ky,log,pg,toc,tp,vr,vrs} $(PDF_FIGS) WWW ?= www web: $(WWW) $(addprefix $(WWW)/,index.html $(SOURCE).html $(wildcard *.png) $(SOURCE).pdf) $(WWW): mkdir $@ $(WWW)/index.html: index.html sed -e "s//`LC_TIME=C TZ= date`/" < $< > $@ $(WWW)/%: % cp -p $^ $@