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