doc: Minor makefile cleanups
[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 PDF=altusmetrum.pdf micropeak.pdf telegps.pdf $(RELNOTES_PDF) $(ONEFILE_PDF_FILES) \
171         $(OUTLINE_PDF_FILES)
172
173 FOP_STYLE=am-fo.xsl
174 FOP_XCONF=fop.xconf
175 STYLESHEET=am.css
176
177 TEMPLATES_TMPL=titlepage.templates.tmpl
178
179 TEMPLATES_XSL=$(TEMPLATES_TMPL:.tmpl=.xsl)
180
181 PDF_CONFIG_FILES=$(FOP_STYLE) $(FOP_XCONF) $(TEMPLATES_XSL)
182 HTML_CONFIG_FILES=$(TEMPLATES_XSL) $(STYLESHEET)
183
184 DOC=$(HTML) $(PDF) $(IMAGES) $(STYLESHEET)
185
186 .SUFFIXES: .tmpl .xsl .inc .txt .raw .pdf .html
187
188 .txt.raw:
189         sed -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
190
191 .inc.raw:
192         sed -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
193
194 .raw.pdf:
195         a2x -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file $(FOP_STYLE) --fop --fop-opts="-c $(FOP_XCONF)" $*.raw
196
197 .raw.html:
198         a2x -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --stylesheet=$(STYLESHEET) $*.raw
199
200 .tmpl.xsl:
201         xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.tmpl
202
203 all:    $(HTML) $(PDF)
204
205 $(HTML): $(PDF)
206
207 altusmetrum.pdf altusmetrum.html: altusmetrum-docinfo.xml $(RAW_FILES) $(RAW_INC) $(IMAGES)
208
209 telegps.html telegps.pdf: telegps-docinfo.xml $(TELEGPS_RAW_FILES) $(IMAGES)
210
211 micropeak.pdf micropeak.html: micropeak-docinfo.xml $(MICROPEAK_RAW_FILES) $(IMAGES)
212
213 install:        all
214
215 publish:        $(DOC)
216         cp $(DOC) /home/bdale/web/altusmetrum/AltOS/doc/
217         (cd /home/bdale/web/altusmetrum ; \
218          git add /home/bdale/web/altusmetrum/AltOS/doc/* ; \
219          echo "update docs" | \
220          git commit -F - /home/bdale/web/altusmetrum/AltOS/doc/* ; \
221          git push)
222
223 publish-keithp: $(DOC)
224         scp -p $(DOC) keithp.com:~keithp/public_html/altos
225
226 clean:
227         rm -f $(HTML) $(PDF) $(TEMPLATES_XSL) $(RAW_FILES) $(TELEGPS_RAW_FILES) $(MICROPEAK_RAW_FILES)
228
229 distclean: clean
230         rm -f $(HTML) $(PDF)
231
232 $(PDF): $(PDF_CONFIG_FILES)
233 $(HTML): $(HTML_CONFIG_FILES)