+RAW_FILES=$(TXT_FILES:.txt=.raw) $(INC_FILES:.inc=.raw)
+
+TELEGPS_INC_FILES=\
+ dedication.inc \
+ telegps-quick-start.inc \
+ telegps-using.inc \
+ telegps-system-operation.inc \
+ telegps-application.inc \
+ handling.inc \
+ telegps-specs.inc \
+ telegps-updating-firmware.inc \
+ telegps-release-notes.inc
+
+TELEGPS_TXT_FILES=\
+ telegps.txt
+
+TELEGPS_RAW_FILES=$(TELEGPS_TXT_FILES:.txt=.raw) $(TELEGPS_INC_FILES:.inc=.raw)
+
+MICROPEAK_TXT_FILES=\
+ micropeak.txt
+
+MICROPEAK_INC_FILES=
+
+MICROPEAK_RAW_FILES=$(MICROPEAK_TXT_FILES:.txt=.raw) $(MICROPEAK_INC_FILES:.inc=.raw)
+
+OUTLINE_TXT_FILES=\
+ easymega-outline.txt \
+ easymini-outline.txt \
+ telemega-outline.txt \
+ telemetrum-outline.txt \
+ telemini-outline.txt
+
+OUTLINE_RAW_FILES=$(OUTLINE_TXT_FILES:.txt=.raw)
+
+OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
+
+SVG=\
+ easymini.svg \
+ telemega.svg \
+ telemetrum.svg \
+ telemini.svg \
+ easymega.svg
+
+RELNOTES_PDF=$(RELNOTES_INC:.inc=.pdf)
+RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
+
+HTML=altusmetrum.html altos.html telemetry.html companion.html micropeak.html telegps.html $(RELNOTES_HTML)
+
+PDF=altusmetrum.pdf $(RELNOTES_PDF) altos.pdf telemetry.pdf companion.pdf micropeak.pdf telegps.pdf \
+ $(OUTLINE_PDF_FILES)
+
+FOSTYLE=xorg-fo.xsl
+
+TEMPLATES_TMPL=titlepage.templates.tmpl
+
+TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
+
+IMAGES=$(PICTURES) $(SVG)
+
+DOC=$(HTML) $(PDF) $(IMAGES)
+
+.SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
+
+XSLTFLAGS=--stringparam section.autolabel 1 --xinclude
+
+.txt.raw:
+ sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[ ]*//' -e 's/^\\//' $*.txt > $@
+
+.inc.raw:
+ sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[ ]*//' -e 's/^\\//' $*.inc > $@
+
+.raw.pdf:
+ a2x --verbose -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file am-fo.xsl --fop --fop-opts="-c fop.xconf" $*.raw
+
+.raw.html:
+ a2x --verbose -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --stylesheet=am.css $*.raw
+
+.tmpl.xsl:
+ xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl