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