doc: Construct html index for documentation
[fw/altos] / doc / Makefile
1 #
2 #       http://docbook.sourceforge.net/release/xsl/current/README
3 #
4
5 RELNOTES_INC=\
6         release-notes-1.6.1.inc \
7         release-notes-1.6.inc \
8         release-notes-1.5.inc \
9         release-notes-1.4.2.inc \
10         release-notes-1.4.1.inc \
11         release-notes-1.4.inc \
12         release-notes-1.3.2.inc \
13         release-notes-1.3.1.inc \
14         release-notes-1.3.inc \
15         release-notes-1.2.1.inc \
16         release-notes-1.2.inc \
17         release-notes-1.1.1.inc \
18         release-notes-1.1.inc \
19         release-notes-1.0.1.inc \
20         release-notes-0.9.2.inc \
21         release-notes-0.9.inc \
22         release-notes-0.8.inc \
23         release-notes-0.7.1.inc
24
25 IMAGES=\
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         easymega.svg \
35         easymega-v1.0-bottom.jpg \
36         easymega-v1.0-top.jpg \
37         easymini.svg \
38         easymini-top.jpg \
39         fire-igniter.png \
40         graph-configure.png \
41         graph-map.png \
42         graph.png \
43         graph-stats.png \
44         ignitor.png \
45         landed.png \
46         launch-pad.png \
47         load-maps.png \
48         micropeak-app.png \
49         micropeak-back.jpg \
50         micropeak-device-dialog.png \
51         micropeak-dime.jpg \
52         micropeak-download.png \
53         micropeak-graph-configure.png \
54         micropeak-graph.png \
55         micropeak-nofont.svg \
56         micropeak-preferences.png \
57         micropeak-raw-data.png \
58         micropeak-save-dialog.png \
59         micropeak-statistics.png \
60         MicroPeakUSB-2.0-inuse.jpg \
61         MicroPeakUSB-2.0.jpg \
62         monitor-idle.png \
63         scan-channels.png \
64         site-map.png \
65         table.png \
66         telegps-configure.png \
67         telegps-graph-configure.png \
68         telegps-graph-graph.png \
69         telegps-graph-map.png \
70         telegps-graph-stats.png \
71         telegps-info.png \
72         telegps-location.png \
73         telegps-map.png \
74         telegps-preferences.png \
75         telegps-scan.png \
76         telegps-status.png \
77         telegps-table.png \
78         telegps-v1.0-top.jpg \
79         telemega.svg \
80         telemega-v1.0-top.jpg \
81         telemetrum.svg \
82         telemetrum-v1.1-thside.jpg \
83         telemetrum-v2.0-th.jpg \
84         telemini.svg \
85         telemini-v1-top.jpg \
86         telemini-v2-top.jpg \
87         altusmetrum-oneline.svg \
88         telegps-oneline.svg \
89         micropeak-oneline.svg
90
91 TXT_FILES=altusmetrum.txt
92
93 COMMON_INC_FILES=\
94         config-device.inc \
95         config-ui.inc \
96         load-maps.inc \
97         aprs-operation.inc \
98         handling.inc
99
100 INC_FILES=\
101         dedication.inc \
102         intro.inc \
103         getting-started.inc \
104         usage.inc \
105         telemetrum.inc \
106         telemini-v1.0.inc \
107         telemini-v2.0.inc \
108         easymini-device.inc \
109         telemega.inc \
110         easymega.inc \
111         installation.inc \
112         using-am-products.inc \
113         updating-firmware.inc \
114         altosui.inc \
115         altosdroid.inc \
116         system-operation.inc \
117         pyro-channels.inc \
118         flight-data-recording.inc \
119         specs.inc \
120         $(COMMON_INC_FILES) \
121         release-notes.inc \
122         $(RELNOTES_INC)
123
124 RAW_FILES=$(TXT_FILES:.txt=.raw) $(INC_FILES:.inc=.raw)
125
126 TELEGPS_INC_FILES=\
127         telegps-dedication.inc \
128         telegps-quick-start.inc \
129         telegps-using.inc \
130         telegps-system-operation.inc \
131         telegps-application.inc \
132         telegps-specs.inc \
133         telegps-updating-firmware.inc \
134         telegps-release-notes.inc \
135         $(COMMON_INC_FILES)
136
137 TELEGPS_TXT_FILES=\
138         telegps.txt
139
140 TELEGPS_RAW_FILES=$(TELEGPS_TXT_FILES:.txt=.raw) $(TELEGPS_INC_FILES:.inc=.raw)
141
142 MICROPEAK_TXT_FILES=\
143         micropeak.txt
144
145 MICROPEAK_INC_FILES=
146
147 MICROPEAK_RAW_FILES=$(MICROPEAK_TXT_FILES:.txt=.raw) $(MICROPEAK_INC_FILES:.inc=.raw)
148
149 EASYMINI_TXT_FILES=\
150         easymini.txt
151
152 EASYMINI_INC_FILES=$(INC_FILES) easymini-release-notes.inc
153
154
155 EASYMINI_RAW_FILES=$(EASYMINI_TXT_FILES:.txt=.raw) $(EASYMINI_INC_FILES:.inc=.raw)
156
157 OUTLINE_TXT_FILES=\
158         easymega-outline.txt \
159         easymini-outline.txt \
160         telemega-outline.txt \
161         telemetrum-outline.txt \
162         telemini-outline.txt
163
164 OUTLINE_RAW_FILES=$(OUTLINE_TXT_FILES:.txt=.raw)
165
166 OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
167
168 SVG=\
169         easymini.svg \
170         telemega.svg \
171         telemetrum.svg \
172         telemini.svg \
173         easymega.svg
174
175 RELNOTES_PDF=$(RELNOTES_INC:.inc=.pdf)
176 RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
177
178 ONEFILE_TXT_FILES=\
179         altos.txt \
180         companion.txt \
181         telemetry.txt
182
183 ONEFILE_RAW_FILES=$(ONEFILE_TXT_FILES:.txt=.raw)
184 ONEFILE_PDF_FILES=$(ONEFILE_TXT_FILES:.txt=.pdf)
185
186 AM_HTML=am.html
187
188 HTML=altusmetrum.html micropeak.html telegps.html easymini.html $(RELNOTES_HTML) $(ONEFILE_HTML_FILES)
189
190 HTML_REVHISTORY=\
191         altusmetrum-revhistory.html \
192         micropeak-revhistory.html \
193         telegps-revhistory.html \
194         easymini-revhistory.html
195
196 PDF=altusmetrum.pdf micropeak.pdf telegps.pdf easymini.pdf $(RELNOTES_PDF) $(ONEFILE_PDF_FILES) \
197         $(OUTLINE_PDF_FILES)
198
199 FOP_STYLE=am-fo.xsl
200 HTML_STYLE=am-html.xsl
201 COMMON_STYLE=common.xsl
202 FOP_XCONF=fop.xconf
203 STYLESHEET=am.css
204
205 FONTS=\
206         fonts/DejaVuSansMono-BoldOblique.ttf \
207         fonts/DejaVuSansMono-Bold.ttf \
208         fonts/DejaVuSansMono-Oblique.ttf \
209         fonts/DejaVuSansMono.ttf \
210         fonts/OpenSans-Light.ttf \
211         fonts/OpenSans-LightItalic.ttf \
212         fonts/OpenSans-Regular.ttf \
213         fonts/OpenSans-Italic.ttf \
214         fonts/OpenSans-Semibold.ttf \
215         fonts/OpenSans-SemiboldItalic.ttf
216
217 TEMPLATES_TMPL=titlepage.templates.tmpl
218
219 TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
220
221 PDF_CONFIG_FILES=$(FOP_STYLE) $(COMMON_STYLE) $(FOP_XCONF) $(TEMPLATES_XSL)
222 HTML_CONFIG_FILES=$(HTML_STYLE) $(COMMON_STYLE) $(TEMPLATES_XSL)
223
224 DOC=$(HTML) $(HTML_REVHISTORY) $(PDF) $(IMAGES) $(STYLESHEET)
225
226 .SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
227
228 .txt.raw:
229         sed -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
230
231 .inc.raw:
232         sed -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
233
234 .raw.pdf:
235         a2x --verbose -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(FOP_STYLE) --fop --fop-opts="-c $(FOP_XCONF)" $*.raw
236         a2x --verbose -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(HTML_STYLE) --stylesheet=$(STYLESHEET) $*.raw
237
238 .pdf.html:
239         @touch $@
240
241 .tmpl.xsl:
242         xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
243
244 all:    $(HTML) $(PDF)
245
246 altusmetrum-revhistory.html: altusmetrum.html
247
248 micropeak-revhistory.html: micropeak.html
249
250 telegps-revhistory.html: telegps.html
251
252 altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(IMAGES)
253
254 telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
255
256 micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
257
258 easymini.pdf easymini.html: easymini-docinfo.xml $(EASYMINI_RAW_FILES) $(IMAGES)
259
260 install:        all
261
262 publish:        $(DOC) $(FONTS)
263         cp $(DOC) /home/bdale/web/altusmetrum/AltOS/doc/
264         mkdir -p /home/bdale/web/altusmetrum/AltOS/doc/fonts/
265         cp $(FONTS) /home/bdale/web/altusmetrum/AltOS/doc/fonts/
266         (cd /home/bdale/web/altusmetrum ; \
267          git add /home/bdale/web/altusmetrum/AltOS/doc/* ; \
268          git add /home/bdale/web/altusmetrum/AltOS/doc/fonts/* ; \
269          echo "update docs" | \
270          git commit -F - /home/bdale/web/altusmetrum/AltOS/doc/* /home/bdale/web/altusmetrum/AltOS/doc/fonts/* ; \
271          git push)
272
273 publish-keithp: am.html $(DOC) $(FONTS)
274         scp -p am.html $(DOC) keithp.com:~keithp/public_html/altos
275         scp -p $(FONTS) keithp.com:~keithp/public_html/altos/fonts
276
277 clean:
278         rm -f am.html $(HTML) $(HTML_REVHISTORY) $(PDF) $(TEMPLATES_XSL) $(RAW_FILES) $(TELEGPS_RAW_FILES) $(MICROPEAK_RAW_FILES)
279
280 distclean: clean
281         rm -f $(HTML) $(PDF)
282
283 $(PDF): $(PDF_CONFIG_FILES)
284 $(HTML): $(HTML_CONFIG_FILES)
285
286 am.html: Makefile make-am-html $(HTML)
287         sh ./make-am-html $(HTML) > $@