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