Which release notes targets we can build no longer depends on whether we HAVE_FOP.
[metze/wireshark/wip.git] / docbook / Makefile.am
1 #
2 # Make the "Wireshark User Guide" and "Wireshark Developer Guide"
3 # in several formats.
4 # See the Readme.txt file for instructions.
5 #
6 # $Id$
7 #
8
9 # formatting objects processor
10 # Additional options to fop.
11 # This needs to contain at least the argument '-Xmx256m'
12 # fop executable is found in configure.ac.
13 FOP_OPTS=-Xmx256m
14
15 # Asciidoc converter
16 A2X_HTML_OPTS="--stylesheet=ws.css"
17 A2X_TEXT_OPTS=
18
19 #if HAVE_LYNX
20 A2X_TEXT_OPTS+="--lynx"
21 #endif
22
23 # html to text converter for text version of release notes, e.g. elinks.
24 # This could also be "lynx", or "true" if neither elinks nor lynx is installed
25 # (See Bug # 1446 for note re 'force-html' below)
26 # Sorry about the indenting, but that's what automake requires...
27 if HAVE_ELINKS
28 HTML2TXT=$(ELINKS) -dump -dump-width 72
29 ## links: -dump requires 'url' argument (as opposed to elinks & lynx)
30 ## (Rather than fixing things we'll just disable the use of links).
31 ##else
32 ##if HAVE_LINKS
33 ##HTML2TXT=$(LINKS) -dump -width 72
34 else
35 if HAVE_LYNX
36 HTML2TXT=$(LYNX) -dump -width=72 -nolist -stdin -force-html
37 else
38 HTML2TXT="true"
39 endif
40 ##endif
41 endif
42
43 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
44
45 include Makefile.common
46
47 # Automatically generate .pdf files from .fo files
48 # Suse needs FOP_OPTS, Debian needs JAVA_OPTS
49 .fo.pdf:
50 if HAVE_FOP
51         FOP_OPTS=$(FOP_OPTS) JAVA_OPTS=$(FOP_OPTS) $(FOP) $< $@
52 else
53         @echo
54         @echo "Error: FOP is needed to create PDFs!"
55         @false
56 endif
57
58
59 if HAVE_XSLTPROC
60 ALL_TARGETS=svn_version_check wsug wsdg release_notes
61 else
62 # if we don't have XSLTPROC, there's nothing to do...
63 ALL_TARGETS=svn_version_check
64 endif
65
66 all: $(ALL_TARGETS)
67
68 #
69 # on every build, record the working copy revision string
70 #
71 # FORCE is the portable version of .PHONY
72 FORCE:
73
74 svn_version_check: FORCE
75         cat $(srcdir)/check_svn_version.sh | tr -d '\015' | /bin/bash
76
77 svn_version.xml: svn_version_check
78
79 # Wireshark User Guide
80 if HAVE_FOP
81 WSUG_TARGETS=wsug.validated wsug_html_chunked user-guide.html user-guide-a4.pdf user-guide-us.pdf
82 else
83 WSUG_TARGETS=wsug.validated wsug_html_chunked user-guide.html
84 endif
85
86 wsug: $(WSUG_TARGETS)
87
88 # validate the content
89 wsug.validated: $(WSUG_SOURCE) wsluarm
90 if HAVE_XMLLINT
91         @ echo --- WSUG - VALIDATING XML ---
92         $(XMLLINT) --valid --noout $<
93         touch $@
94 else
95         @ echo --- WSUG - SKIP VALIDATION ---
96 endif
97
98 # create html single page file
99 user-guide.html: wsug_html/user-guide.html
100
101 wsug_html/user-guide.html: $(WSUG_SOURCE) wsluarm
102         @ echo --- WSUG - HTML SINGLE PAGE ---
103         mkdir -p wsug_html/wsug_graphics/toolbar
104         cp $(srcdir)/wsug_graphics/*.* wsug_html/wsug_graphics
105         cp $(srcdir)/wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
106         cp $(srcdir)/ws.css wsug_html
107         $(XSLTPROC) --stringparam base.dir wsug_html/ --stringparam  use.id.as.filename 1 \
108                     --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ \
109                     --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 \
110                     --stringparam html.stylesheet ws.css \
111                     --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > $@
112         -chmod -R og+rX wsug_html
113
114 # create html chunked page files
115 wsug_html_chunked: wsug_html_chunked/index.html
116
117 wsug_html_chunked/index.html: $(WSUG_SOURCE) wsluarm
118         @ echo --- WSUG - HTML CHUNKED ---
119         mkdir -p wsug_html_chunked/wsug_graphics/toolbar
120         cp $(srcdir)/wsug_graphics/*.* wsug_html_chunked/wsug_graphics
121         cp $(srcdir)/wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
122         cp $(srcdir)/ws.css wsug_html_chunked
123         $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ --stringparam  use.id.as.filename 1 \
124                     --stringparam admon.graphics 1 --stringparam admon.graphics.path wsug_graphics/ \
125                     --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 \
126                     --stringparam html.stylesheet ws.css \
127                     --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $<
128         -chmod -R og+rX wsug_html_chunked
129
130 # create pdf file (through XSL-FO), portrait pages on US letter paper
131 # you will get lot's of errors, but that's ok
132 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
133         @ echo --- WSUG - PDF US PAPER ---
134         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@
135
136 # create pdf file (through XSL-FO), portrait pages on A4 paper
137 # you will get lot's of errors, but that's ok
138 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
139         @ echo --- WSUG - PDF A4 PAPER ---
140         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@
141
142 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
143         mkdir -p wsluarm_src
144         $(PERL) $(srcdir)/make-wsluarm.pl $(WSLUA_MODULES)
145         touch wsluarm
146
147
148 # Wireshark Developer Guide
149 if HAVE_FOP
150 WSDG_TARGETS=wsdg.validated wsdg_html_chunked developer-guide.html developer-guide-a4.pdf developer-guide-us.pdf
151 else
152 WSDG_TARGETS=wsdg.validated wsdg_html_chunked developer-guide.html
153 endif
154
155 wsdg: $(WSDG_TARGETS)
156
157 # validate the content
158 wsdg.validated: $(WSDG_SOURCE)
159 if HAVE_XMLLINT
160         @ echo --- WSDG - VALIDATING XML ---
161         $(XMLLINT) --valid --noout $<
162         touch $@
163 else
164         @ echo --- WSDG - SKIP VALIDATION ---
165 endif
166
167 # create html single page file
168 developer-guide.html: wsdg_html/developer-guide.html
169
170 wsdg_html/developer-guide.html: $(WSDG_SOURCE)
171         @ echo --- WSDG - HTML SINGLE PAGE ---
172         mkdir -p wsdg_html/wsdg_graphics/toolbar
173         cp $(srcdir)/wsdg_graphics/*.* wsdg_html/wsdg_graphics
174         cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar/
175         cp $(srcdir)/ws.css wsdg_html
176         $(XSLTPROC) --stringparam base.dir wsdg_html/ --stringparam  use.id.as.filename 1 \
177                     --stringparam admon.graphics 1 --stringparam admon.graphics.path wsdg_graphics/ \
178                     --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 \
179                     --stringparam html.stylesheet ws.css \
180                     --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > $@
181         -chmod -R og+rX wsdg_html
182
183 # create html chunked page files
184 wsdg_html_chunked: wsdg_html_chunked/index.html
185
186 wsdg_html_chunked/index.html: $(WSDG_SOURCE)
187         @ echo --- WSDG - HTML CHUNKED ---
188         mkdir -p wsdg_html_chunked/wsdg_graphics/toolbar
189         cp $(srcdir)/wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics
190         cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar/
191         cp $(srcdir)/ws.css wsdg_html_chunked
192         $(XSLTPROC) --stringparam base.dir wsdg_html_chunked/ --stringparam  use.id.as.filename 1 \
193                     --stringparam admon.graphics 1 --stringparam admon.graphics.path wsdg_graphics/  \
194                     --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 \
195                     --stringparam html.stylesheet ws.css \
196                     --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $<
197         -chmod -R og+rX wsdg_html_chunked
198
199 # create pdf file (through XSL-FO), portrait pages on US letter paper
200 # you will get lot's of errors, but that's ok
201 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
202         @ echo --- WSDG - PDF US PAPER ---
203         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@
204
205 # create pdf file (through XSL-FO), portrait pages on A4 paper
206 # you will get lot's of errors, but that's ok
207 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
208         @ echo --- WSDG - PDF A4 PAPER ---
209         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@
210
211
212 RELEASE_NOTES_TARGETS=release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
213
214 release_notes: $(RELEASE_NOTES_TARGETS)
215
216 # create html single page file
217 release-notes.html: $(RELEASE_NOTES_SOURCE)
218         @ echo --- RELEASE NOTES - HTML ---
219         $(A2X) --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
220
221 # create txt single page file (through HTML)
222 release-notes.txt: $(RELEASE_NOTES_SOURCE)
223         @ echo --- RELEASE NOTES - TXT ---
224         $(A2X) --format=text $(A2X_TEXT_OPTS) \
225                 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
226                 release-notes.asciidoc
227         mv release-notes.text $@
228
229 news: release-notes.txt
230         cp release-notes.txt ../NEWS
231
232 # create pdf file, portrait pages on US letter paper
233 release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
234         @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
235         $(A2X) --format=pdf $(A2X_HTML_OPTS) --fop \
236                 --xsltproc-opts "--stringparam paper.type letter --nonet" \
237                 --xsl-file=custom_layer_pdf.xsl \
238                 release-notes.asciidoc
239         mv release-notes.pdf $@
240
241 # create pdf file, portrait pages on A4 paper
242 release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
243         @ echo --- RELEASE NOTES - PDF A4 PAPER ---
244         $(A2X) --format=pdf $(A2X_HTML_OPTS) --fop \
245                 --xsltproc-opts "--stringparam paper.type A4 --nonet" \
246                 --xsl-file=custom_layer_pdf.xsl \
247                 release-notes.asciidoc
248         mv release-notes.pdf $@
249
250 clean-local:
251         -rm -rf $(CLEANDIRS)
252
253 EXTRA_DIST = \
254         $(WSUG_SOURCE)          \
255         $(WSDG_SOURCE)          \
256         $(RELEASE_NOTES_SOURCE) \
257         check_svn_version.sh    \
258         docbook.vcproj          \
259         dfilter2xml.pl          \
260         make-wsluarm.pl         \
261         README.txt              \
262         Makefile.nmake          \
263         CMakeLists.txt
264
265 MAINTAINERCLEANFILES = \
266         Makefile.in