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