2 # Make the "Wireshark User Guide" and "Wireshark Developer Guide"
4 # See the Readme.txt file for instructions.
6 ## Use: $(MAKE) /$(MAKEFLAGS) -f makefile.nmake [target ...]
11 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
14 include ..\config.nmake
15 include Makefile.common
17 WSUG_SOURCE = $(WSUG_SOURCE) Makefile.nmake
18 WSDG_SOURCE = $(WSDG_SOURCE) Makefile.nmake
19 RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
22 A2X_HTML_OPTS="--stylesheet=ws.css"
26 A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
29 # Automatically generate .pdf files from .fo files
35 # On every build, record the working copy revision string
36 # in svn_version.xml (if the svn version has changed).
37 # This is done during nmake "preprocessing" so that it's done *before*
38 # nmake gets the date/time of the dependency file(s)].
39 !IF [$(SH) ./check_svn_version.sh]
43 # -- (Public) targets -------------------------------------------------------
49 wsug: wsug.validated wsug_x
52 wsdg: wsdg.validated wsdg_x
54 # Make only the release notes
55 release_notes: $(RELEASE_NOTES_SOURCE)
59 rm -rf $(CLEANFILES) $(CLEANDIRS)
63 maintainer-clean: distclean
65 # -- All -------------------------------------------------------------------------------
67 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
69 # -- User Guide ------------------------------------------------------------------------
71 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
73 # validate the content
74 wsug.validated: $(WSUG_SOURCE) wsluarm
75 @ echo --- WSUG - VALIDATING XML ---
76 $(XMLLINT) --valid --noout user-guide.xml
79 # create html single page file
80 wsug_html: wsug_html\index.html
82 wsug_html\index.html: $(WSUG_SOURCE) wsluarm
83 @ echo --- WSUG - HTML SINGLE PAGE ---
84 if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
85 cp wsug_graphics/*.* wsug_html/wsug_graphics
86 cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
88 $(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 > $@
89 -chmod -R og+rX wsug_html
91 # create html chunked page files
92 wsug_html_chunked: wsug_html_chunked\index.html
94 wsug_html_chunked\index.html: $(WSUG_SOURCE) wsluarm
95 @ echo --- WSUG - HTML CHUNKED ---
96 if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
97 cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
98 cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
99 cp ws.css wsug_html_chunked
100 $(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
101 -chmod -R og+rX wsug_html_chunked
103 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
104 # you will get lot's of errors, but that's ok
105 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
107 @ echo --- WSUG - PDF US PAPER ---
108 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
111 # create pdf file (through XSL-FO), portrait pages on A4 paper
112 # you will get lot's of errors, but that's ok
113 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
115 @ echo --- WSUG - PDF A4 PAPER ---
116 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
119 # create MS html help file (through html chunked pages)
120 user-guide.chm: $(WSUG_SOURCE) wsluarm
122 @ echo --- WSUG - MICROSOFT HTML HELP ---
123 if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
124 -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
125 -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
126 $(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
127 -$(HHC_EXE) htmlhelp.hhp
133 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
134 if not exist wsluarm_src md wsluarm_src
135 $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
138 # -- Developer's Guide ------------------------------------------------------------------------
140 wsdg_x: wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
142 # validate the content
143 wsdg.validated: $(WSDG_SOURCE)
144 @ echo --- WSDG - VALIDATING XML ---
145 $(XMLLINT) --valid --noout developer-guide.xml
148 # create html single page file
149 wsdg_html: wsdg_html\index.html
151 wsdg_html\index.html: $(WSDG_SOURCE)
152 @ echo --- WSDG - HTML SINGLE PAGE ---
153 if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
154 if not exist wsdg_html\wsdg_graphics\toolbar md wsdg_html\wsdg_graphics\toolbar
155 cp wsdg_graphics/*.* wsdg_html/wsdg_graphics/
156 cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar/
158 $(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 > $@
159 -chmod -R og+rX wsdg_html
161 # create html chunked page files
162 wsdg_html_chunked: wsdg_html_chunked\index.html
164 wsdg_html_chunked\index.html: $(WSDG_SOURCE)
165 @ echo --- WSDG - HTML CHUNKED ---
166 if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
167 if not exist wsdg_html_chunked\wsdg_graphics\toolbar md wsdg_html_chunked\wsdg_graphics\toolbar
168 cp wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics/
169 cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar/
170 cp ws.css wsdg_html_chunked
171 $(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
172 -chmod -R og+rX wsdg_html_chunked
174 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
175 # you will get lot's of errors, but that's ok
176 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
178 @ echo --- WSDG - PDF US PAPER ---
179 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
182 # create pdf file (through XSL-FO), portrait pages on A4 paper
183 # you will get lot's of errors, but that's ok
184 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
186 @ echo --- WSDG - PDF A4 PAPER ---
187 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
190 # create MS html help file (through html chunked pages)
191 developer-guide.chm: $(WSDG_SOURCE)
193 @ echo --- WSDG - MICROSOFT HTML HELP ---
194 if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
195 if not exist wsdg_chm\wsdg_graphics\toolbar md wsdg_chm\wsdg_graphics\toolbar
196 cp wsdg_graphics/*.* wsdg_chm/wsdg_graphics/
197 cp wsdg_graphics/toolbar/* wsdg_chm/wsdg_graphics/toolbar/
198 $(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
199 -$(HHC_EXE) htmlhelp.hhp
205 # -- Release Notes ------------------------------------------------------------------------
207 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
209 # create html single page file
210 release-notes.html: $(RELEASE_NOTES_SOURCE)
211 @ echo --- RELEASE NOTES - HTML ---
214 $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
217 # create txt single page file (through HTML)
218 release-notes.txt: $(RELEASE_NOTES_SOURCE)
219 @ echo --- RELEASE NOTES - TXT ---
222 $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
223 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
224 release-notes.asciidoc
226 mv release-notes.text $@
228 news: release-notes.txt
229 copy release-notes.txt ..\NEWS
231 # create pdf file, portrait pages on US letter paper
232 release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
233 @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
236 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
237 --xsltproc-opts "--stringparam paper.type letter --nonet" \
238 --xsl-file=custom_layer_pdf.xsl \
239 release-notes.asciidoc
241 mv release-notes.pdf $@
243 # create pdf file, portrait pages on A4 paper
244 release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
245 @ echo --- RELEASE NOTES - PDF A4 PAPER ---
248 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
249 --xsltproc-opts "--stringparam paper.type A4 --nonet" \
250 --xsl-file=custom_layer_pdf.xsl \
251 release-notes.asciidoc
253 mv release-notes.pdf $@