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