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