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