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