+DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
+
+.SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
+
+.txt.raw:
+ sed -e 's/^[ ]*//' -e 's/^\\//' $*.txt > $@
+
+.inc.raw:
+ sed -e 's/^[ ]*//' -e 's/^\\//' $*.inc > $@
+
+.raw.pdf:
+ a2x -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(FOP_STYLE) --fop --fop-opts="-c $(FOP_XCONF)" $*.raw
+
+.raw.html:
+ a2x -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(HTML_STYLE) --stylesheet=$(STYLESHEET) $*.raw
+
+.tmpl.xsl:
+ xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
+
+all: $(HTML) $(PDF)
+
+$(HTML): $(PDF)
+
+altusmetrum-revhistory.html: altusmetrum.html
+
+micropeak-revhistory.html: micropeak.html
+
+telegps-revhistory.html: telegps.html
+
+altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(RAW_INC) $(IMAGES)
+
+telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
+
+micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
+
+install: all
+
+publish: $(DOC) $(FONTS)
+ cp $(DOC) /home/bdale/web/altusmetrum/AltOS/doc/
+ mkdir -p /home/bdale/web/altusmetrum/AltOS/doc/fonts/
+ cp $(FONTS) /home/bdale/web/altusmetrum/AltOS/doc/fonts/
+ (cd /home/bdale/web/altusmetrum ; \
+ git add /home/bdale/web/altusmetrum/AltOS/doc/* ; \
+ git add /home/bdale/web/altusmetrum/AltOS/doc/fonts/* ; \
+ echo "update docs" | \
+ git commit -F - /home/bdale/web/altusmetrum/AltOS/doc/* /home/bdale/web/altusmetrum/AltOS/doc/fonts/* ; \
+ git push)
+
+publish-keithp: $(DOC) $(FONTS)
+ scp -p $(DOC) keithp.com:~keithp/public_html/altos
+ scp -p $(FONTS) keithp.com:~keithp/public_html/altos/fonts
+
+clean:
+ rm -f $(HTML) $(HTML_REVHISTORY) $(PDF) $(TEMPLATES_XSL) $(RAW_FILES) $(TELEGPS_RAW_FILES) $(MICROPEAK_RAW_FILES)