doc: Add updating firmware and using am products asciidoc bits
[fw/altos] / doc / Makefile
1 #
2 #       http://docbook.sourceforge.net/release/xsl/current/README
3 #
4
5 RELNOTES=\
6         release-notes-0.7.1.html \
7         release-notes-0.8.html \
8         release-notes-0.9.html \
9         release-notes-0.9.2.html \
10         release-notes-1.0.1.html \
11         release-notes-1.1.html \
12         release-notes-1.1.1.html \
13         release-notes-1.2.html \
14         release-notes-1.2.1.html \
15         release-notes-1.3.html \
16         release-notes-1.3.1.html \
17         release-notes-1.3.2.html \
18         release-notes-1.4.html \
19         release-notes-1.4.1.html \
20         release-notes-1.5.html \
21         release-notes-1.6.html \
22         release-notes-1.6.1.html
23
24 PICTURES=\
25         altosui.png \
26         ascent.png \
27         configure-altimeter.png \
28         configure-altosui.png \
29         configure-groundstation.png \
30         configure-pyro.png \
31         descent.png \
32         device-selection.png \
33         easymini-top.jpg \
34         fire-igniter.png \
35         graph-configure.png \
36         graph-map.png \
37         graph.png \
38         graph-stats.png \
39         landed.png \
40         launch-pad.png \
41         load-maps.png \
42         micropeak-app.png \
43         micropeak-back.jpg \
44         micropeak-device-dialog.png \
45         micropeak-dime.jpg \
46         micropeak-download.png \
47         micropeak-graph-configure.png \
48         micropeak-graph.png \
49         micropeak-preferences.png \
50         micropeak-raw-data.png \
51         micropeak-save-dialog.png \
52         micropeak-statistics.png \
53         MicroPeakUSB-2.0-inuse.jpg \
54         MicroPeakUSB-2.0.jpg \
55         monitor-idle.png \
56         scan-channels.png \
57         site-map.png \
58         table.png \
59         telemega-v1.0-top.jpg \
60         telemetrum-v1.1-thside.jpg \
61         telemini-v1-top.jpg \
62         telemini-v2-top.jpg
63
64 TXT_FILES=altusmetrum.txt
65 INC_FILES=\
66         dedication.inc \
67         intro.inc \
68         getting-started.inc \
69         usage.inc \
70         telemetrum.inc \
71         telemini-v1.0.inc \
72         telemini-v2.0.inc \
73         easymini.inc \
74         telemega.inc \
75         easymega.inc \
76         installation.inc \
77         using-am-products.inc \
78         updating-firmware.inc \
79         altosui.inc \
80         altosdroid.inc \
81         system-operation.inc \
82         pyro-channels.inc \
83         flight-data-recording.inc \
84         handling.inc \
85         specs.inc
86
87 RAW_FILES=$(TXT_FILES:.txt=.raw)
88
89 RAW_INC=$(INC_FILES:.inc=.raw)
90
91 AD_PDF=$(TXT_FILES:.txt=.pdf)
92
93 SVG=\
94         easymini.svg \
95         telemega.svg \
96         telemetrum.svg \
97         telemini.svg \
98         easymega.svg
99
100 RELNOTES_XSL=$(RELNOTES:.html=.xsl)
101 HTML=altusmetrum.html altos.html telemetry.html companion.html micropeak.html telegps.html $(RELNOTES)
102 PDF=altusmetrum.pdf altos.pdf telemetry.pdf companion.pdf micropeak.pdf telegps.pdf \
103         telemetrum-outline.pdf telemega-outline.pdf easymini-outline.pdf easymega-outline.pdf $(AD_PDF)
104 HTMLSTYLE=/usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl
105 FOSTYLE=xorg-fo.xsl
106 FOPCFG=fop-cfg.xml
107 TEMPLATES=titlepage.templates.xsl
108 PDFSTYLE=
109 IMAGES=$(PICTURES) $(SVG)
110 DOC=$(HTML) $(PDF) $(IMAGES)
111
112 .SUFFIXES: .inc .txt .raw .pdf .html
113
114 XSLTFLAGS=--stringparam section.autolabel 1 --xinclude
115
116 .txt.raw:
117         sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[    ]*//' -e 's/^\\//' $*.txt > $@
118
119 .inc.raw:
120         sed -e 's/@@VERSION@@/$(VERSION)/' -e 's/@@DATE@@/$(DATE)/' -e 's/^[    ]*//' -e 's/^\\//' $*.inc > $@
121
122 .raw.pdf:
123         a2x --verbose -k -d book -a docinfo -f pdf --xsltproc-opts "--stringparam toc.section.depth 2" --xsl-file am-fo.xsl --fop --fop-opts="-c fop.xconf" $*.raw
124
125 .raw.html:
126         a2x --verbose -k -d book -a docinfo -f xhtml --xsltproc-opts "--stringparam toc.section.depth 2" --stylesheet=am.css $*.raw
127
128 .xsl.html:
129         xsltproc $(XSLTFLAGS) -o $@ $(HTMLSTYLE) $*.xsl
130
131 .xsl.pdf:
132         xmlto -p '-c $(FOPCFG)' --searchpath `pwd` -x $(FOSTYLE) --with-fop pdf $*.xsl
133
134 .xml.xsl:
135         xsltproc --output $@ /usr/share/xml/docbook/stylesheet/docbook-xsl/template/titlepage.xsl $*.xml
136
137 all:    $(HTML) $(PDF)
138
139 altusmetrum.pdf: altusmetrum-docinfo.xml $(RAW_FILES) $(RAW_INC)
140
141 install:        all
142
143 publish:        $(DOC)
144         cp $(DOC) /home/bdale/web/altusmetrum/AltOS/doc/
145         (cd /home/bdale/web/altusmetrum ; \
146          git add /home/bdale/web/altusmetrum/AltOS/doc/* ; \
147          echo "update docs" | \
148          git commit -F - /home/bdale/web/altusmetrum/AltOS/doc/* ; \
149          git push)
150
151 clean:
152         rm -f $(HTML) $(PDF) $(TEMPLATES)
153
154 distclean:
155         rm -f $(HTML) $(PDF)
156
157 altusmetrum.html: $(RELNOTES_XSL) $(IMAGES)
158 altusmetrum.pdf: $(RELNOTES_XSL) $(IMAGES)
159
160 telegps.html: $(RELNOTES_XSL) $(IMAGES)
161 telegps.pdf: $(RELNOTES_XSL) $(IMAGES)
162
163 $(PDF): $(FOSTYLE) $(TEMPLATES) $(FOPCFG)
164
165 indent:         altusmetrum.xsl
166         xmlindent -i 2 < altusmetrum.xsl > altusmetrum.new
167
168 $(FOPCFG): Makefile
169         (echo '<fop version="1.0">'; echo '  <base>'"`pwd`"'</base>'; echo '</fop>') > $@
170