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