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