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