The contents of the NEWS file come from the release notes. Back-port
[obnox/wireshark/wip.git] / docbook / Makefile.nmake
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 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake
7 #
8 # $Id$
9 #
10
11 # formatting objects processor
12 # Additional options to fop.
13 # This needs to contain at least the argument '-Xmx256m'
14 FOP_OPTS=-Xmx256m
15
16 # fop executable
17 # Leave these commented out if you don't have fop instlled or you
18 # don't want PDF documentation.
19 #
20 # for win32 (cygwin) environments (as of fop-0.20 the cygwin script does
21 # not use $FOP_OPTS)
22 !IFNDEF FOP
23 FOP=fop-0.20.5\fop.bat
24 !ENDIF
25 #
26 # for unix like environments (if you have problems with fop, try to use an absolute path here)
27 #FOP=fop-0.20.5/fop.sh
28 #
29 # One SUSE 9.1 and newer uncomment the following line (make sure you have
30 # at least fop-0.20.5-71.2)
31 #FOP=fop
32
33 # html help compiler (Win32 only)
34 # Leave these commented out if you don't have HHC installed or you
35 # don't want CHM documentation.
36 HHC="C:\Program Files\HTML Help Workshop\hhc.exe"
37 #HHC="true"
38
39 # html to text converter for text version of release notes, e.g. elinks.
40 # This could also be "lynx", or "true" if neither elinks nor lynx is installed
41 # (cygwin: lynx works, elinks not available, links and true doesn't produce output)
42 #HTML2TXT=elinks -dump -dump-width 72
43 #HTML2TXT=links -dump -width 72
44 HTML2TXT=lynx -dump -width=72 -nolist -stdin
45 #HTML2TXT="true"
46
47 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
48
49 include ..\config.nmake
50 include Makefile.common
51
52 # the XSL processor
53 XSLTPROC="xsltproc"
54
55 # the XML validator (from the xsltproc package)
56 XMLLINT="xmllint"
57
58 # Automatically generate .pdf files from .fo files
59 # Suse needs FOP_OPTS, Debian needs JAVA_OPTS
60 .fo.pdf:
61         $(FOP) $< $@
62
63 # FOP_OPTS="$(FOP_OPTS) $(JAVA_OPTS)" $(FOP) $< $@
64
65
66 all: svn_version_check wsug.validated wsdg.validated release_notes.validated wsug wsdg release_notes
67
68 clean:
69         rm -rf $(CLEANFILES)
70
71 .SUFFIXES: .fo .pdf
72
73 #
74 # on every build, record the working copy revision string
75 #
76 # FORCE is the portable version of .PHONY
77 FORCE:
78
79 svn_version_check: FORCE
80         @ $(SH) ./check_svn_version.sh
81
82 svn_version.xml: svn_version_check
83
84
85 wsug: wsug_html_chunked user-guide.html user-guide-a4.pdf user-guide-us.pdf user-guide.chm user-guide.zip
86
87 # validate the content
88 wsug.validated: $(WSUG_SOURCE)
89         @ echo --- WSUG - VALIDATING XML ---
90         $(XMLLINT) --valid --noout user-guide.xml
91         touch $@
92
93 # create html single page file
94 user-guide.html: wsug_html/user-guide.html
95
96 wsug_html/user-guide.html: $(WSUG_SOURCE)
97         @ echo --- WSUG - HTML SINGLE PAGE ---
98         if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
99         cp wsug_graphics/*.* wsug_html/wsug_graphics
100         cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
101         cp ws.css wsug_html
102         $(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 user-guide.xml > $@
103         -chmod -R og+rX wsug_html
104
105 # create html chunked page files
106 wsug_html_chunked: wsug_html_chunked\index.html
107
108 wsug_html_chunked\index.html: $(WSUG_SOURCE)
109         @ echo --- WSUG - HTML CHUNKED ---
110         if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
111         cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
112         cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
113         cp ws.css wsug_html_chunked
114         $(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 user-guide.xml
115         -chmod -R og+rX wsug_html_chunked
116
117 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
118 # you will get lot's of errors, but that's ok
119 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
120 !ifdef FOP
121         @ echo --- WSUG - PDF US PAPER ---
122         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
123 !endif
124
125 # create pdf file (through XSL-FO), portrait pages on A4 paper
126 # you will get lot's of errors, but that's ok
127 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
128 !ifdef FOP
129         @ echo --- WSUG - PDF A4 PAPER ---
130         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
131 !endif
132
133 # create MS html help file (through html chunked pages)
134 user-guide.chm: $(WSUG_SOURCE)
135 !ifdef HHC
136         @ echo --- WSUG - MICROSOFT HTML HELP ---
137         if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
138         -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
139         -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
140         $(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 user-guide.xml 
141         -$(HHC) htmlhelp.hhp
142         -mv htmlhelp.chm $@
143         -rm -r htmlhelp.hhp
144         -rm -r toc.hhc
145
146 user-guide.zip: user-guide.chm
147         rm -f user-guide.zip
148         zip user-guide.zip user-guide.chm
149 !else
150 user-guide.zip:
151 !endif
152
153 wsdg: wsdg_html_chunked developer-guide.html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
154
155 # validate the content
156 wsdg.validated: $(WSDG_SOURCE)
157         @ echo --- WSDG - VALIDATING XML ---
158         $(XMLLINT) --valid --noout developer-guide.xml
159         touch $@
160
161 # create html single page file
162 developer-guide.html: wsdg_html/developer-guide.html
163
164 wsdg_html/developer-guide.html: $(WSDG_SOURCE)
165         @ echo --- WSDG - HTML SINGLE PAGE ---
166         if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
167         cp wsdg_graphics/* wsdg_html/wsdg_graphics
168         cp ws.css wsdg_html
169         $(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 developer-guide.xml > $@
170         -chmod -R og+rX wsdg_html
171
172 # create html chunked page files
173 wsdg_html_chunked: wsdg_html_chunked/index.html
174
175 wsdg_html_chunked/index.html: $(WSDG_SOURCE)
176         @ echo --- WSDG - HTML CHUNKED ---
177         if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
178         cp wsdg_graphics/* wsdg_html_chunked/wsdg_graphics
179         cp ws.css wsdg_html_chunked
180         $(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 developer-guide.xml
181         -chmod -R og+rX wsdg_html_chunked
182
183 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
184 # you will get lot's of errors, but that's ok
185 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
186 !ifdef FOP
187         @ echo --- WSDG - PDF US PAPER ---
188         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
189 !endif
190
191 # create pdf file (through XSL-FO), portrait pages on A4 paper
192 # you will get lot's of errors, but that's ok
193 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
194 !ifdef FOP
195         @ echo --- WSDG - PDF A4 PAPER ---
196         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
197 !endif
198
199 # create MS html help file (through html chunked pages)
200 developer-guide.chm: $(WSDG_SOURCE)
201 !ifdef HHC
202         @ echo --- WSDG - MICROSOFT HTML HELP ---
203         if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
204         cp wsdg_graphics/* wsdg_chm/wsdg_graphics
205         $(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 developer-guide.xml
206         -$(HHC) htmlhelp.hhp
207         -mv htmlhelp.chm $@
208         -rm -r htmlhelp.hhp
209         -rm -r toc.hhc
210 !endif
211
212
213 release_notes: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf release-notes.chm
214
215 # validate the content
216 release_notes.validated: $(RELEASE_NOTES_SOURCE)
217         @ echo --- RELEASE NOTES - VALIDATING XML ---
218         $(XMLLINT) --valid --noout release-notes.xml
219         touch $@
220
221 # create html single page file
222 release-notes.html: $(RELEASE_NOTES_SOURCE)
223         @ echo --- RELEASE NOTES - HTML ---
224         $(XSLTPROC) --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml > $@
225
226 # create txt single page file (through HTML)
227 release-notes.txt: $(RELEASE_NOTES_SOURCE)
228         @ echo --- RELEASE NOTES - TXT ---
229         $(XSLTPROC) --stringparam generate.toc "article nop" --nonet http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl release-notes.xml | $(HTML2TXT) > $@
230
231 news: release-notes.txt
232         copy release-notes.txt ..\NEWS
233
234 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
235 # you will get lot's of errors, but that's ok
236 release-notes-us.fo: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
237 !ifdef FOP
238         @ echo --- RELEASE NOTES - PDF US PAPER ---
239         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl release-notes.xml > $@
240 !endif
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 !ifdef FOP
246         @ echo --- RELEASE NOTES - PDF A4 PAPER ---
247         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl release-notes.xml > $@
248 !endif
249
250 # create MS html help file (through html chunked pages)
251 release-notes.chm: $(RELEASE_NOTES_SOURCE)
252 !ifdef HHC
253         @ echo --- RELEASE NOTES - MICROSOFT HTML HELP ---
254         $(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 release-notes.xml
255         -$(HHC) htmlhelp.hhp
256         -mv htmlhelp.chm $@
257         -rm -r htmlhelp.hhp
258         -rm -r toc.hhc
259 !endif
260