4561cffb0e5ce6a0d763f4279a483964895ec402
[obnox/wireshark/wip.git] / docbook / Makefile
1 #
2 # Make the "Ethereal User's Guide" in several formats.
3 # See the Readme.txt file for instructions.
4 #
5 # $Id$
6 #
7
8 # formatting objects processor
9 # Additional options to fop.
10 # This needs to contain at least the argument '-Xmx256m'
11 FOP_OPTS=-Xmx256m
12
13 # fop executable
14 # Leave these commented out if you don't have fop instlled or you
15 # don't want PDF documentation.
16 #
17 # for win32 (cygwin) environments (as of fop-0.20 the cygwin script does
18 # not use $FOP_OPTS)
19 #FOP=fop-0.20.5/fop.bat
20 #
21 # for unix like environments (if you have problems with fop, try to use an absolute path here)
22 #FOP=fop-0.20.5/fop.sh
23 #
24 # One SUSE 9.1 and 9.2 uncomment the following line (make sure you have at least fop-0.20.5-71.2)
25 #FOP=fop
26
27 # html help compiler (Win32 only)
28 # Leave these commented out if you don't have HHC installed or you
29 # don't want CHM documentation.
30 #HHC="/cygdrive/c/Program Files/HTML Help Workshop/hhc.exe"
31 #HHC="true"
32
33 # elinks (text version of release notes)
34 # This could also be "lynx", or "true" if neither elinks nor lynx is installed
35 #ELINKS=elinks
36 ELINKS="true"
37
38 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
39
40 # the XSL processor
41 XSLTPROC="xsltproc"
42
43 # the XML validator (from the xsltproc package)
44 XMLLINT="xmllint"
45
46 # Automatically generate .pdf files from .fo files
47 .fo.pdf:
48         FOP_OPTS="$(FOP_OPTS)" $(FOP) $< $@
49
50 WSUG_FILES =    \
51         wsug_src/WSUG_app_files.xml \
52         wsug_src/WSUG_app_howitworks.xml \
53         wsug_src/WSUG_app_messages.xml \
54         wsug_src/WSUG_app_protocols.xml \
55         wsug_src/WSUG_app_tools.xml \
56         wsug_src/WSUG_chapter_advanced.xml \
57         wsug_src/WSUG_chapter_build_install.xml \
58         wsug_src/WSUG_chapter_capture.xml \
59         wsug_src/WSUG_chapter_customize.xml \
60         wsug_src/WSUG_chapter_introduction.xml \
61         wsug_src/WSUG_chapter_io.xml \
62         wsug_src/WSUG_chapter_statistics.xml \
63         wsug_src/WSUG_chapter_troubleshoot.xml \
64         wsug_src/WSUG_chapter_use.xml \
65         wsug_src/WSUG_chapter_work.xml \
66         wsug_src/WSUG_meta_info.xml \
67         wsug_src/WSUG_preface.xml
68
69 WSUG_GRAPHICS = \
70         graphics/ethereal-3pane.png                     \
71         graphics/ethereal-analyze-menu.png              \
72         graphics/ethereal-bytes-pane-popup-menu.png     \
73         graphics/ethereal-bytes-pane-tabs.png           \
74         graphics/ethereal-bytes-pane.png                \
75         graphics/ethereal-capture-info.png              \
76         graphics/ethereal-capture-interfaces.png        \
77         graphics/ethereal-capture-menu.png              \
78         graphics/ethereal-capture-options.png           \
79         graphics/ethereal-capture-preferences.png       \
80         graphics/ethereal-choose-color-rule.png         \
81         graphics/ethereal-coloring-rules-dialog.png     \
82         graphics/ethereal-decode-as-show.png            \
83         graphics/ethereal-decode-as.png                 \
84         graphics/ethereal-details-pane-popup-menu.png   \
85         graphics/ethereal-details-pane.png              \
86         graphics/ethereal-display-filter-tcp.png        \
87         graphics/ethereal-edit-color-rule-dialog.png    \
88         graphics/ethereal-edit-menu.png                 \
89         graphics/ethereal-empty.png                     \
90         graphics/ethereal-enabled-protocols.png         \
91         graphics/ethereal-error-file-exists.png         \
92         graphics/ethereal-error-open.png                \
93         graphics/ethereal-export-pdml.png               \
94         graphics/ethereal-export-plain.png              \
95         graphics/ethereal-export-ps.png                 \
96         graphics/ethereal-export-psml.png               \
97         graphics/ethereal-export-selected.png           \
98         graphics/ethereal-file-menu.png                 \
99         graphics/ethereal-file-set-dialog.png           \
100         graphics/ethereal-filter-add-expression.png     \
101         graphics/ethereal-filter-toolbar.png            \
102         graphics/ethereal-filters-2.png                 \
103         graphics/ethereal-filters.png                   \
104         graphics/ethereal-find-packet.png               \
105         graphics/ethereal-follow-stream.png             \
106         graphics/ethereal-go-menu.png                   \
107         graphics/ethereal-goto-packet.png               \
108         graphics/ethereal-gui-colors-preferences.png    \
109         graphics/ethereal-gui-columns-preferences.png   \
110         graphics/ethereal-gui-font-preferences.png      \
111         graphics/ethereal-gui-layout-preferences.png    \
112         graphics/ethereal-gui-preferences.png           \
113         graphics/ethereal-help-menu.png                 \
114         graphics/ethereal-list-pane.png                 \
115         graphics/ethereal-main-toolbar.png              \
116         graphics/ethereal-menu.png                      \
117         graphics/ethereal-merge.png                     \
118         graphics/ethereal-nameresolution-preferences.png        \
119         graphics/ethereal-open.png                      \
120         graphics/ethereal-packet-format.png             \
121         graphics/ethereal-packet-pane-popup-menu.png    \
122         graphics/ethereal-packet-range.png              \
123         graphics/ethereal-packet-selected.png           \
124         graphics/ethereal-packet-sep-win.png            \
125         graphics/ethereal-print.png                     \
126         graphics/ethereal-printing-preferences.png      \
127         graphics/ethereal-save-as.png                   \
128         graphics/ethereal-statistics-menu.png           \
129         graphics/ethereal-stats-conversations.png       \
130         graphics/ethereal-stats-endpoints.png           \
131         graphics/ethereal-stats-hierarchy.png           \
132         graphics/ethereal-stats-iographs.png            \
133         graphics/ethereal-stats-srt-dcerpc-filter.png   \
134         graphics/ethereal-stats-srt-dcerpc.png          \
135         graphics/ethereal-stats-summary.png             \
136         graphics/ethereal-statusbar-empty.png           \
137         graphics/ethereal-statusbar-loaded.png          \
138         graphics/ethereal-statusbar-selected.png        \
139         graphics/ethereal-time-reference.png            \
140         graphics/ethereal-view-menu.png                 \
141         graphics/note.png                               \
142         graphics/tip.png                                \
143         graphics/warning.png                            \
144         graphics/toolbar/autoscroll_24.png              \
145         graphics/toolbar/capture_filter_24.png          \
146         graphics/toolbar/capture_interfaces_24.png      \
147         graphics/toolbar/capture_options_24.png         \
148         graphics/toolbar/capture_restart_24.png         \
149         graphics/toolbar/capture_start_24.png           \
150         graphics/toolbar/capture_stop_24.png            \
151         graphics/toolbar/colorize_24.png                \
152         graphics/toolbar/display_filter_24.png          \
153         graphics/toolbar/resize_columns_24.png          \
154         graphics/toolbar/stock_add_24.png               \
155         graphics/toolbar/stock_bottom_24.png            \
156         graphics/toolbar/stock_close_24.png             \
157         graphics/toolbar/stock_colorselector_24.png     \
158         graphics/toolbar/stock_help_24.png              \
159         graphics/toolbar/stock_jump_to_24.png           \
160         graphics/toolbar/stock_left_arrow_24.png        \
161         graphics/toolbar/stock_open_24.png              \
162         graphics/toolbar/stock_preferences_24.png       \
163         graphics/toolbar/stock_print_24.png             \
164         graphics/toolbar/stock_properties_24.png        \
165         graphics/toolbar/stock_refresh_24.png           \
166         graphics/toolbar/stock_right_arrow_24.png       \
167         graphics/toolbar/stock_save_24.png              \
168         graphics/toolbar/stock_save_as_24.png           \
169         graphics/toolbar/stock_search_24.png            \
170         graphics/toolbar/stock_stop_24.png              \
171         graphics/toolbar/stock_top_24.png               \
172         graphics/toolbar/stock_zoom_1_24.png            \
173         graphics/toolbar/stock_zoom_in_24.png           \
174         graphics/toolbar/stock_zoom_out_24.png          \
175         graphics/wireshark-logo.png                     \
176         graphics/wireshark-main.png
177
178 EDG_FILES =     \
179         edg_src/EDG_chapter_build_intro.xml     \
180         edg_src/EDG_chapter_capture.xml         \
181         edg_src/EDG_chapter_dissection.xml      \
182         edg_src/EDG_chapter_env_intro.xml       \
183         edg_src/EDG_chapter_libraries.xml       \
184         edg_src/EDG_chapter_sources.xml         \
185         edg_src/EDG_chapter_tools.xml           \
186         edg_src/EDG_chapter_userinterface.xml   \
187         edg_src/EDG_chapter_works.xml           \
188         edg_src/EDG_meta_info.xml               \
189         edg_src/EDG_preface.xml
190
191 EDG_GRAPHICS =  \
192         edg_graphics/ethereal-capture-sync.dia          \
193         edg_graphics/ethereal-capture-sync.png          \
194         edg_graphics/ethereal-capture_internals.dia     \
195         edg_graphics/ethereal-capture_internals.png     \
196         edg_graphics/ethereal-function-blocks.dia       \
197         edg_graphics/ethereal-function-blocks.png       \
198         edg_graphics/wireshark-logo.png                 \
199         edg_graphics/note.png                           \
200         edg_graphics/tip.png                            \
201         edg_graphics/warning.png
202
203 # user-guide.xml must be first in the list (to match $<)
204 WSUG_SOURCE =   \
205         user-guide.xml          \
206         svn_version.xml         \
207         $(WSUG_FILES)           \
208         $(WSUG_GRAPHICS)
209
210 # developer-guide.xml must be first in the list (to match $<)
211 EDG_SOURCE =    \
212         developer-guide.xml     \
213         svn_version.xml         \
214         $(EDG_FILES)            \
215         $(EDG_GRAPHICS)
216
217 RELEASE_NOTES_SOURCE = \
218         release-notes.xml       \
219         svn_version.xml
220
221 CLEANFILES =    \
222         *.chm                   \
223         *.fo                    \
224         *.hhc                   \
225         *.hhp                   \
226         *.pdf                   \
227         *.validated             \
228         edg_chm                 \
229         edg_html                \
230         edg_html_chunked        \
231         wsug_chm                \
232         wsug_html               \
233         wsug_html_chunked       \
234         htmlhelp.*              \
235         release_notes_chm       \
236         release-notes.html      \
237         release-notes.txt       \
238         svn_version.xml         \
239
240
241 all: wsug.validated edg.validated release_notes.validated wsug edg release_notes
242
243 clean:
244         rm -rf $(CLEANFILES)
245
246 .SUFFIXES: .fo .pdf
247
248 #
249 # on every build, record the working copy revision string
250 #
251 # FORCE is the portable version of .PHONY
252 FORCE:
253
254 svn_version.xml: FORCE
255         echo -n '<!ENTITY SvnVersion "' > svn_version.xml
256         svnversion -n .                   >> svn_version.xml
257         echo '">'   >> svn_version.xml
258
259
260 wsug: wsug_html_chunked user-guide.html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
261
262 # validate the content
263 wsug.validated: $(WSUG_SOURCE)
264         @ echo --- WSUG - VALIDATING XML ---
265         $(XMLLINT) --valid --noout $<
266         touch $@
267
268 # create html single page file
269 user-guide.html: $(WSUG_SOURCE)
270         @ echo --- WSUG - HTML SINGLE PAGE ---
271         mkdir -p wsug_html/graphics/toolbar
272         cp graphics/*.* wsug_html/graphics
273         cp graphics/toolbar/* wsug_html/graphics/toolbar
274         cp ws.css wsug_html
275         $(XSLTPROC) --stringparam base.dir wsug_html/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > wsug_html/$@
276         -chmod -R og+rX wsug_html
277         
278 # create html chunked page files
279 wsug_html_chunked: $(WSUG_SOURCE)
280         @ echo --- WSUG - HTML CHUNKED ---
281         mkdir -p wsug_html_chunked/graphics/toolbar
282         cp graphics/*.* wsug_html_chunked/graphics
283         cp graphics/toolbar/* wsug_html_chunked/graphics/toolbar
284         cp ws.css wsug_html_chunked
285         $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $<
286         -chmod -R og+rX wsug_html_chunked
287
288 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
289 # you will get lot's of errors, but that's ok
290 user-guide-us.fo: $(WSUG_SOURCE)
291 ifdef FOP
292         @ echo --- WSUG - PDF US PAPER ---
293         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@
294 endif
295
296 # create pdf file (through XSL-FO), portrait pages on A4 paper
297 # you will get lot's of errors, but that's ok
298 user-guide-a4.fo: $(WSUG_SOURCE)
299 ifdef FOP
300         @ echo --- WSUG - PDF A4 PAPER ---
301         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@
302 endif
303
304 # create MS html help file (through html chunked pages)
305 user-guide.chm: $(WSUG_SOURCE)
306 ifdef HHC
307         @ echo --- WSUG - MICROSOFT HTML HELP ---
308         mkdir -p wsug_chm/graphics/toolbar
309         -cp graphics/*.* wsug_chm/graphics/
310         -cp graphics/toolbar/* wsug_chm/graphics/toolbar/
311         $(XSLTPROC) --stringparam base.dir wsug_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1  --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $<
312         -$(HHC) htmlhelp.hhp
313         -mv htmlhelp.chm $@
314         -rm -r htmlhelp.hhp
315         -rm -r toc.hhc
316 endif
317
318
319 edg: edg_html_chunked developer-guide.html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
320
321 # validate the content
322 edg.validated: $(EDG_SOURCE)
323         @ echo --- EDG - VALIDATING XML ---
324         $(XMLLINT) --valid --noout $<
325         touch $@
326
327 # create html single page file
328 developer-guide.html: $(EDG_SOURCE)
329         @ echo --- EDG - HTML SINGLE PAGE ---
330         mkdir -p edg_html/edg_graphics
331         cp edg_graphics/* edg_html/edg_graphics
332         cp ws.css edg_html
333         $(XSLTPROC) --stringparam base.dir edg_html/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path edg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > edg_html/$@
334         -chmod -R og+rX edg_html
335         
336 # create html chunked page files
337 edg_html_chunked: $(EDG_SOURCE)
338         @ echo --- EDG - HTML CHUNKED ---
339         mkdir -p edg_html_chunked
340         mkdir -p edg_html_chunked/edg_graphics
341         cp edg_graphics/* edg_html_chunked/edg_graphics
342         cp ws.css edg_html_chunked
343         $(XSLTPROC) --stringparam base.dir edg_html_chunked/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path edg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl $<
344         -chmod -R og+rX edg_html_chunked
345
346 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
347 # you will get lot's of errors, but that's ok
348 developer-guide-us.fo: $(EDG_SOURCE)
349 ifdef FOP
350         @ echo --- EDG - PDF US PAPER ---
351         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@
352 endif
353
354 # create pdf file (through XSL-FO), portrait pages on A4 paper
355 # you will get lot's of errors, but that's ok
356 developer-guide-a4.fo: $(EDG_SOURCE)
357 ifdef FOP
358         @ echo --- EDG - PDF A4 PAPER ---
359         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@
360 endif
361
362 # create MS html help file (through html chunked pages)
363 developer-guide.chm: $(EDG_SOURCE)
364 ifdef HHC
365         @ echo --- EDG - MICROSOFT HTML HELP ---
366         mkdir -p edg_chm/edg_graphics
367         cp edg_graphics/* edg_chm/edg_graphics
368         $(XSLTPROC) --stringparam base.dir edg_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path edg_graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --stringparam html.stylesheet ws.css --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $<
369         -$(HHC) htmlhelp.hhp
370         -mv htmlhelp.chm $@
371         -rm -r htmlhelp.hhp
372         -rm -r toc.hhc
373 endif
374
375
376 release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf release-notes.chm
377
378 # validate the content
379 release_notes.validated: $(RELEASE_NOTES_SOURCE)
380         @ echo --- RELEASE NOTES - VALIDATING XML ---
381         $(XMLLINT) --valid --noout $<
382         touch $@
383
384 # create html single page file
385 release-notes.html: $(RELEASE_NOTES_SOURCE)
386         @ echo --- RELEASE NOTES - HTML ---
387         $(XSLTPROC) --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< > $@
388
389 # create txt single page file
390 release-notes.txt: $(RELEASE_NOTES_SOURCE)
391         @ echo --- RELEASE NOTES - TXT ---
392         $(XSLTPROC) --stringparam generate.toc "article nop" --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< | $(ELINKS) -dump -dump-width 72 > $@
393         
394 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
395 # you will get lot's of errors, but that's ok
396 release-notes-us.fo: $(RELEASE_NOTES_SOURCE)
397 ifdef FOP
398         @ echo --- RELEASE NOTES - PDF US PAPER ---
399         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl $< > $@
400 endif
401
402 # create pdf file (through XSL-FO), portrait pages on A4 paper
403 # you will get lot's of errors, but that's ok
404 release-notes-a4.fo: $(RELEASE_NOTES_SOURCE)
405 ifdef FOP
406         @ echo --- RELEASE NOTES - PDF A4 PAPER ---
407         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl $< > $@
408 endif
409
410 # create MS html help file (through html chunked pages)
411 release-notes.chm: $(RELEASE_NOTES_SOURCE)
412 ifdef HHC
413         @ echo --- RELEASE NOTES - MICROSOFT HTML HELP ---
414         $(XSLTPROC) --stringparam base.dir release_notes_chm/ --stringparam  use.id.as.filename 1 --stringparam admon.graphics 1 --stringparam admon.graphics.path graphics/ --stringparam section.autolabel 1 --stringparam  section.label.includes.component.label 1 --nonet http://docbook.sourceforge.net/release/xsl/current/htmlhelp/htmlhelp.xsl $<
415         -$(HHC) htmlhelp.hhp
416         -mv htmlhelp.chm $@
417         -rm -r htmlhelp.hhp
418         -rm -r toc.hhc
419 endif
420