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