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