doc: Update for 1.9.7
[fw/altos] / doc / Makefile.am
1 #
2 # Copyright © 2018 Keith Packard <keithp@keithp.com>
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 2 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 # General Public License for more details.
13 #
14
15 if FAKETIME
16 FAKETIME=TZ=UTC faketime -f '$(RELEASE_DATE) 00:00:00 i0'
17 endif
18
19 RELNOTES_INC=\
20         release-notes-1.9.7.inc \
21         release-notes-1.9.6.inc \
22         release-notes-1.9.5.inc \
23         release-notes-1.9.4.inc \
24         release-notes-1.9.3.inc \
25         release-notes-1.9.2.inc \
26         release-notes-1.9.1.inc \
27         release-notes-1.9.inc \
28         release-notes-1.8.7.inc \
29         release-notes-1.8.6.inc \
30         release-notes-1.8.5.inc \
31         release-notes-1.8.4.inc \
32         release-notes-1.8.3.inc \
33         release-notes-1.8.2.inc \
34         release-notes-1.8.1.inc \
35         release-notes-1.8.inc \
36         release-notes-1.7.inc \
37         release-notes-1.6.8.inc \
38         release-notes-1.6.5.inc \
39         release-notes-1.6.4.inc \
40         release-notes-1.6.3.inc \
41         release-notes-1.6.2.inc \
42         release-notes-1.6.1.inc \
43         release-notes-1.6.inc \
44         release-notes-1.5.inc \
45         release-notes-1.4.2.inc \
46         release-notes-1.4.1.inc \
47         release-notes-1.4.inc \
48         release-notes-1.3.2.inc \
49         release-notes-1.3.1.inc \
50         release-notes-1.3.inc \
51         release-notes-1.2.1.inc \
52         release-notes-1.2.inc \
53         release-notes-1.1.1.inc \
54         release-notes-1.1.inc \
55         release-notes-1.0.1.inc \
56         release-notes-0.9.2.inc \
57         release-notes-0.9.inc \
58         release-notes-0.8.inc \
59         release-notes-0.7.1.inc
60
61 IMAGES=\
62         altosui.png \
63         ascent.png \
64         configure-altimeter.png \
65         configure-altosui.png \
66         configure-groundstation.png \
67         configure-pyro.png \
68         descent.png \
69         device-selection.png \
70         easymega.svg \
71         easymega-v1.0-bottom.jpg \
72         easymega-v1.0-top.jpg \
73         easymini.svg \
74         easymini-top.jpg \
75         easytimer.jpg \
76         fire-igniter.png \
77         graph-configure.png \
78         graph-map.png \
79         graph.png \
80         graph-stats.png \
81         ignitor.png \
82         landed.png \
83         launch-pad.png \
84         load-maps.png \
85         micropeak-app.png \
86         micropeak-back.jpg \
87         micropeak-device-dialog.png \
88         micropeak-dime.jpg \
89         micropeak-download.png \
90         micropeak-graph-configure.png \
91         micropeak-graph.png \
92         micropeak-nofont.svg \
93         micropeak-preferences.png \
94         micropeak-raw-data.png \
95         micropeak-save-dialog.png \
96         micropeak-statistics.png \
97         MicroPeakUSB-2.0-inuse.jpg \
98         MicroPeakUSB-2.0.jpg \
99         monitor-idle.png \
100         scan-channels.png \
101         site-map.png \
102         table.png \
103         telegps-configure.png \
104         telegps-graph-configure.png \
105         telegps-graph-graph.png \
106         telegps-graph-map.png \
107         telegps-graph-stats.png \
108         telegps-info.png \
109         telegps-location.png \
110         telegps-map.png \
111         telegps-preferences.png \
112         telegps-scan.png \
113         telegps-status.png \
114         telegps-table.png \
115         telegps-v1.0-top.jpg \
116         telemega.svg \
117         telemega-v1.0-top.jpg \
118         telemetrum.svg \
119         telemetrum-v1.1-thside.jpg \
120         telemetrum-v2.0-th.jpg \
121         telemini-v1.svg \
122         telemini-v1-top.jpg \
123         telemini-v3.svg \
124         telemini-v3.0-top.jpg \
125         telemini-v3.0-bottom.jpg \
126         altusmetrum-oneline.svg \
127         telegps-oneline.svg \
128         micropeak-oneline.svg
129
130 TXT_FILES=altusmetrum.txt
131
132 COMMON_INC_FILES=\
133         config-device.inc \
134         config-ui.inc \
135         load-maps.inc \
136         aprs-operation.inc \
137         handling.inc \
138         release-head.inc
139
140 INC_FILES=\
141         header.inc \
142         dedication.inc \
143         intro.inc \
144         getting-started.inc \
145         usage.inc \
146         telemetrum.inc \
147         telemini.inc \
148         easymini-device.inc \
149         telemega.inc \
150         easymega.inc \
151         easytimer.inc \
152         installation.inc \
153         using-am-products.inc \
154         updating-firmware.inc \
155         altosui.inc \
156         altosdroid.inc \
157         system-operation.inc \
158         pyro-channels.inc \
159         flight-data-recording.inc \
160         specs.inc \
161         $(COMMON_INC_FILES) \
162         release-notes.inc \
163         $(RELNOTES_INC)
164
165 ADOC_FILES=$(TXT_FILES:.txt=.adoc) $(INC_FILES:.inc=.adoc)
166
167 MOTORTEST_TXT_FILES=motortest.txt
168
169 MOTORTEST_INC_FILES=\
170         motortest-configuration.inc \
171         motortest-installation.inc \
172         motortest-intro.inc \
173         motortest-operation.inc
174
175 MOTORTEST_ADOC_FILES=$(MOTORTEST_TXT_FILES:.txt=.adoc) $(MOTORTEST_INC_FILES:.inc=.adoc)
176
177 TELELAUNCH_TXT_FILES=telelaunch.txt
178
179 TELELAUNCH_INC_FILES=\
180         header.inc \
181         telelaunch-acknowledgements.inc \
182         telelaunch-intro.inc \
183         telelaunch-configuration.inc \
184         telelaunch-operation.inc \
185         telelaunch-specs.inc \
186         telelaunch-updating-firmware.inc \
187         telelaunch-cables.inc \
188         telelaunch-troubleshooting.inc 
189
190 TELELAUNCH_ADOC_FILES=$(TELELAUNCH_TXT_FILES:.txt=.adoc) $(TELELAUNCH_INC_FILES:.inc=.adoc)
191
192 TELEGPS_INC_FILES=\
193         telegps-dedication.inc \
194         telegps-quick-start.inc \
195         telegps-using.inc \
196         telegps-system-operation.inc \
197         telegps-application.inc \
198         telegps-specs.inc \
199         telegps-updating-firmware.inc \
200         telegps-release-notes.inc \
201         $(COMMON_INC_FILES)
202
203 TELEGPS_TXT_FILES=\
204         telegps.txt
205
206 TELEGPS_ADOC_FILES=$(TELEGPS_TXT_FILES:.txt=.adoc) $(TELEGPS_INC_FILES:.inc=.adoc)
207
208 MICROPEAK_TXT_FILES=\
209         micropeak.txt
210
211 MICROPEAK_INC_FILES=
212
213 MICROPEAK_ADOC_FILES=$(MICROPEAK_TXT_FILES:.txt=.adoc) $(MICROPEAK_INC_FILES:.inc=.adoc)
214
215 EASYMINI_TXT_FILES=\
216         easymini.txt
217
218 EASYMINI_INC_FILES=$(INC_FILES) easymini-release-notes.inc
219
220
221 EASYMINI_ADOC_FILES=$(EASYMINI_TXT_FILES:.txt=.adoc) $(EASYMINI_INC_FILES:.inc=.adoc)
222
223 OUTLINE_TXT_FILES=\
224         easymega-outline.txt \
225         easymini-outline.txt \
226         telemega-outline.txt \
227         telemetrum-outline.txt \
228         telemini-v1-outline.txt \
229         telemini-v3-outline.txt \
230         telegps-outline.txt
231
232 OUTLINE_ADOC_FILES=$(OUTLINE_TXT_FILES:.txt=.adoc)
233
234 OUTLINE_PDF_FILES=$(OUTLINE_TXT_FILES:.txt=.pdf)
235
236 SVG=\
237         easymini.svg \
238         telemega.svg \
239         telemetrum.svg \
240         telemini-v1.svg \
241         telemini-v3.svg \
242         easymega.svg
243
244 RELNOTES_HTML=$(RELNOTES_INC:.inc=.html)
245
246 ONEFILE_TXT_FILES=\
247         altos.txt \
248         companion.txt \
249         telemetry.txt \
250         map-loading.txt
251
252 ONEFILE_ADOC_FILES=$(ONEFILE_TXT_FILES:.txt=.adoc)
253 ONEFILE_PDF_FILES=$(ONEFILE_TXT_FILES:.txt=.pdf)
254 ONEFILE_HTML_FILES=$(ONEFILE_TXT_FILES:.txt=.html)
255
256 AM_HTML=am.html
257
258 PUBLISH_HTML=altusmetrum.html micropeak.html telegps.html easymini.html motortest.html telelaunch.html $(ONEFILE_HTML_FILES)
259
260 HTML=$(PUBLISH_HTML) $(RELNOTES_HTML)
261
262 if ASCIIDOCTOR_PDF
263 PDF=altusmetrum.pdf micropeak.pdf telegps.pdf easymini.pdf motortest.pdf telelaunch.pdf $(ONEFILE_PDF_FILES) \
264         $(OUTLINE_PDF_FILES)
265 endif
266
267 MAP_DOT_FILES=map-loading.dot
268 MAP_SVG_FILES=$(MAP_DOT_FILES:.dot=.svg)
269 STYLESHEET=am.css am-notoc.css
270
271 FONTS=\
272         fonts/DejaVuSansMono-BoldOblique.ttf \
273         fonts/DejaVuSansMono-Bold.ttf \
274         fonts/DejaVuSansMono-Oblique.ttf \
275         fonts/DejaVuSansMono.ttf \
276         fonts/OpenSans-Light.ttf \
277         fonts/OpenSans-LightItalic.ttf \
278         fonts/OpenSans-Regular.ttf \
279         fonts/OpenSans-Italic.ttf \
280         fonts/OpenSans-Semibold.ttf \
281         fonts/OpenSans-SemiboldItalic.ttf
282
283 ICONS=\
284         images/icons/caution.svg \
285         images/icons/important.svg \
286         images/icons/note.svg \
287         images/icons/tip.svg \
288         images/icons/warning.svg
289
290 PDF_CONFIG_FILES=altusmetrum-theme.yml
291 HTML_CONFIG_FILES=
292
293 PUBLISH_DOC=$(PUBLISH_HTML) $(PDF) $(IMAGES) $(MAP_SVG_FILES) $(STYLESHEET)
294
295 DOC=$(HTML) $(PDF) $(IMAGES) $(MAP_SVG_FILES) $(STYLESHEET)
296
297 SUFFIXES = .dot .svg .inc .txt .adoc .pdf .html
298
299 ATTRIBUTES=--attribute="revdate=$(DOC_DATE)" --attribute="version=$(VERSION)"
300
301 .dot.svg:
302         dot -Tsvg -o$@ $*.dot
303
304 .txt.adoc:
305         sed -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
306
307 .inc.adoc:
308         sed -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
309
310 .adoc.html:
311         asciidoctor $(ATTRIBUTES) -b html5 $*.adoc
312
313 .adoc.pdf:
314         asciidoctor-pdf $(ATTRIBUTES) $*.adoc
315
316 all:    $(HTML) $(PDF)
317
318 map-loading.adoc: $(MAP_SVG_FILES)
319
320 altusmetrum.pdf altusmetrum.html: $(ADOC_FILES) $(IMAGES)
321
322 motortest.pdf motortest.html: $(MOTORTEST_ADOC_FILES) $(IMAGES)
323
324 telelaunch.pdf telelaunch.html: $(TELELAUNCH_ADOC_FILES) $(IMAGES)
325
326 telegps.html telegps.pdf: $(TELEGPS_ADOC_FILES) $(IMAGES)
327
328 micropeak.pdf micropeak.html: $(MICROPEAK_ADOC_FILES) $(IMAGES)
329
330 easymini.pdf easymini.html: $(EASYMINI_ADOC_FILES) $(IMAGES)
331
332 telemini-v1-outline.pdf: telemini-v1-outline.txt telemini-v1.svg
333
334 telemini-v3-outline.pdf: telemini-v3-outline.txt telemini-v3.svg
335
336 install:        all
337
338 WEB_ROOT=/home/bdale/web/
339
340 publish:        $(PUBLISH_DOC) $(FONTS) $(ICONS)
341         cp -a $(PUBLISH_DOC) $(WEB_ROOT)/altusmetrum/AltOS/doc/
342         mkdir -p $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
343         cp $(FONTS) $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/
344         mkdir -p $(WEB_ROOT)/altusmetrum/AltOS/doc/images/icons/
345         cp $(ICONS) $(WEB_ROOT)/altusmetrum/AltOS/doc/images/icons/
346         (cd $(WEB_ROOT)/altusmetrum ; \
347          git add $(WEB_ROOT)/altusmetrum/AltOS/doc/* ; \
348          git add $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* ; \
349          git add $(WEB_ROOT)/altusmetrum/AltOS/doc/images/icons/* ;\
350          echo "update docs" | \
351          git commit -F - $(WEB_ROOT)/altusmetrum/AltOS/doc/* $(WEB_ROOT)/altusmetrum/AltOS/doc/fonts/* $(WEB_ROOT)/altusmetrum/AltOS/doc/images/icons ; \
352          git push)
353
354 publish-keithp: am.html $(DOC) $(FONTS)
355         ssh keithp.com 'mkdir -p ~keithp/public_html/altos/fonts ~keithp/public_html/altos/images/icons'
356         scp -p am.html $(DOC) keithp.com:~keithp/public_html/altos
357         scp -p $(FONTS) keithp.com:~keithp/public_html/altos/fonts
358         scp -p $(ICONS) keithp.com:~keithp/public_html/altos/images/icons
359
360 clean:
361         rm -f am.html $(HTML) $(PDF) $(ADOC_FILES) $(TELEGPS_ADOC_FILES) $(MICROPEAK_ADOC_FILES) $(TELELAUNCH_ADOC_FILES) $(MOTORTEST_ADOC_FILES)
362
363 distclean: clean
364         rm -f $(HTML) $(PDF)
365
366 $(PDF): $(PDF_CONFIG_FILES)
367 $(HTML): $(HTML_CONFIG_FILES)
368
369 am.html: Makefile make-am-html $(HTML)
370         sh ./make-am-html $(HTML) > $@