doc: Finish converting docs to asciidoc format
[fw/altos] / doc / Makefile
1 #
2 #       http://docbook.sourceforge.net/release/xsl/current/README
3 #
4
5 RELNOTES_INC=\
6         release-notes-0.7.1.inc \
7         release-notes-0.8.inc \
8         release-notes-0.9.inc \
9         release-notes-0.9.2.inc \
10         release-notes-1.0.1.inc \
11         release-notes-1.1.inc \
12         release-notes-1.1.1.inc \
13         release-notes-1.2.inc \
14         release-notes-1.2.1.inc \
15         release-notes-1.3.inc \
16         release-notes-1.3.1.inc \
17         release-notes-1.3.2.inc \
18         release-notes-1.4.inc \
19         release-notes-1.4.1.inc \
20         release-notes-1.4.2.inc \
21         release-notes-1.5.inc \
22         release-notes-1.6.inc \
23         release-notes-1.6.1.inc
24
25 PICTURES=\
26         altosui.png \
27         ascent.png \
28         configure-altimeter.png \
29         configure-altosui.png \
30         configure-groundstation.png \
31         configure-pyro.png \
32         descent.png \
33         device-selection.png \
34         easymini-top.jpg \
35         fire-igniter.png \
36         graph-configure.png \
37         graph-map.png \
38         graph.png \
39         graph-stats.png \
40         landed.png \
41         launch-pad.png \
42         load-maps.png \
43         micropeak-app.png \
44         micropeak-back.jpg \
45         micropeak-device-dialog.png \
46         micropeak-dime.jpg \
47         micropeak-download.png \
48         micropeak-graph-configure.png \
49         micropeak-graph.png \
50         micropeak-preferences.png \
51         micropeak-raw-data.png \
52         micropeak-save-dialog.png \
53         micropeak-statistics.png \
54         MicroPeakUSB-2.0-inuse.jpg \
55         MicroPeakUSB-2.0.jpg \
56         monitor-idle.png \
57         scan-channels.png \
58         site-map.png \
59         table.png \
60         telemega-v1.0-top.jpg \
61         telemetrum-v1.1-thside.jpg \
62         telemini-v1-top.jpg \
63         telemini-v2-top.jpg
64
65 TXT_FILES=altusmetrum.txt
66
67 INC_FILES=\
68         dedication.inc \
69         intro.inc \
70         getting-started.inc \
71         usage.inc \
72         telemetrum.inc \
73         telemini-v1.0.inc \
74         telemini-v2.0.inc \
75         easymini.inc \
76         telemega.inc \
77         easymega.inc \
78         installation.inc \
79         using-am-products.inc \
80         updating-firmware.inc \
81         altosui.inc \
82         altosdroid.inc \
83         system-operation.inc \
84         pyro-channels.inc \
85         flight-data-recording.inc \
86         handling.inc \
87         specs.inc \
88         release-notes.inc \
89         $(RELNOTES_INC)
90
91 RAW_FILES=$(TXT_FILES:.txt=.raw) $(INC_FILES:.inc=.raw)
92
93 TELEGPS_INC_FILES=\
94         dedication.inc \
95         telegps-quick-start.inc \
96         telegps-using.inc \
97         telegps-system-operation.inc \
98         telegps-application.inc \
99         handling.inc \
100         telegps-specs.inc \
101         telegps-updating-firmware.inc \
102         telegps-release-notes.inc
103
104 TELEGPS_TXT_FILES=\
105         telegps.txt
106
107 TELEGPS_RAW_FILES=$(TELEGPS_TXT_FILES:.txt=.raw) $(TELEGPS_INC_FILES:.inc=.raw)
108
109 MICROPEAK_TXT_FILES=\
110         micropeak.txt
111
112 MICROPEAK_INC_FILES=
113
114 MICROPEAK_RAW_FILES=$(MICROPEAK_TXT_FILES:.txt=.raw) $(MICROPEAK_INC_FILES:.inc=.raw)
115
116 OUTLINE_TXT_FILES=\
117         easymega-outline.txt \
118         easymini-outline.txt \
119         telemega-outline.txt \
120         telemetrum-outline.txt \
121         telemini-outline.txt
122
123 OUTLINE_RAW_FILES=$(OUTLINE_TXT_FILES:.txt=.raw)
124
125 OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
126
127 SVG=\
128         easymini.svg \
129         telemega.svg \
130         telemetrum.svg \
131         telemini.svg \
132         easymega.svg
133
134 RELNOTES_PDF=$(RELNOTES_INC:.inc=.pdf)
135 RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
136
137 HTML=altusmetrum.html altos.html telemetry.html companion.html micropeak.html telegps.html $(RELNOTES_HTML)
138
139 PDF=altusmetrum.pdf $(RELNOTES_PDF) altos.pdf telemetry.pdf companion.pdf micropeak.pdf telegps.pdf \
140         $(OUTLINE_PDF_FILES)
141
142 FOSTYLE=xorg-fo.xsl
143
144 TEMPLATES_TMPL=titlepage.templates.tmpl
145
146 TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
147
148 IMAGES=$(PICTURES) $(SVG)
149
150 DOC=$(HTML) $(PDF) $(IMAGES)
151
152 .SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
153
154 XSLTFLAGS=--stringparam section.autolabel 1 --xinclude
155
156 .txt.raw:
157         sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
158
159 .inc.raw:
160         sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
161
162 .raw.pdf:
163         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
164
165 .raw.html:
166         a2x --verbose -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --stylesheet=am.css $*.raw
167
168 .tmpl.xsl:
169         xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
170
171 all:    $(HTML) $(PDF)
172
173 $(HTML): $(PDF)
174
175 altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(RAW_INC) $(IMAGES)
176
177 telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
178
179 micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
180
181 install:        all
182
183 publish:        $(DOC)
184         cp $(DOC) /home/bdale/web/altusmetrum/AltOS/doc/
185         (cd /home/bdale/web/altusmetrum ; \
186          git add /home/bdale/web/altusmetrum/AltOS/doc/* ; \
187          echo "update docs" | \
188          git commit -F - /home/bdale/web/altusmetrum/AltOS/doc/* ; \
189          git push)
190
191 clean:
192         rm -f $(HTML) $(PDF) $(TEMPLATES_XSL)
193
194 distclean: clean
195         rm -f $(HTML) $(PDF)
196
197 $(PDF): $(FOSTYLE) $(TEMPLATES_XSL)
198 $(HTML): $(TEMPLATES_XSL)