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 ...]
9 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
12 include ..\config.nmake
14 include Makefile.common
16 WSUG_SOURCE = $(WSUG_SOURCE) Makefile.nmake
17 WSDG_SOURCE = $(WSDG_SOURCE) Makefile.nmake
18 RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
21 A2X_HTML_OPTS="--stylesheet=ws.css"
25 A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
28 # Automatically generate .pdf files from .fo files
34 # -- (Public) targets -------------------------------------------------------
40 wsug: wsug.validated wsug_x
43 wsdg: wsdg.validated wsdg_x
45 # Make only the release notes
46 release_notes: release_notes_x
50 rm -rf $(CLEANFILES) $(CLEANDIRS)
54 maintainer-clean: distclean
56 # -- All -------------------------------------------------------------------------------
58 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
60 # -- Documentation version ------------------------------------------------------------------------
62 # On every build, record the working copy revision string
63 # in git_version.xml (if the git version has changed).
64 # This is done during nmake "preprocessing" so that it's done *before*
65 # nmake gets the date/time of the dependency file(s)].
66 git_version_check: _FORCE_
67 $(SH) ./check_git_version.sh
69 git_version.xml: git_version_check
71 # -- User Guide ------------------------------------------------------------------------
73 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
75 user-guide.xml: user-guide.asciidoc $(WSUG_FILES) user-guide-docinfo.xml
76 @ echo --- WSUG - XML ---
82 --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
88 # validate the content
89 wsug.validated: $(WSUG_SOURCE)
90 @ echo --- WSUG - VALIDATING XML ---
91 $(XMLLINT) --valid --noout user-guide.xml
94 # create html single page file
95 wsug_html: wsug_html\index.html
97 wsug_html\index.html: $(WSUG_SOURCE)
98 @ echo --- WSUG - HTML SINGLE PAGE ---
99 if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
100 cp wsug_graphics/*.* wsug_html/wsug_graphics
101 cp common_graphics/*.* wsug_html/wsug_graphics
102 cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
104 $(XSLTPROC) --stringparam base.dir wsug_html/ $(COMMON_XSLTPROC_ARGS) \
105 $(WSUG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) user-guide.xml > $@
107 # create html chunked page files
108 wsug_html_chunked: wsug_html_chunked\index.html
110 wsug_html_chunked\index.html: $(WSUG_SOURCE)
111 @ echo --- WSUG - HTML CHUNKED ---
112 if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
113 cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
114 cp common_graphics/*.* wsug_html_chunked/wsug_graphics
115 cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
116 cp ws.css wsug_html_chunked
117 $(XSLTPROC) --stringparam base.dir wsug_html_chunked/ $(COMMON_XSLTPROC_ARGS) \
118 $(WSUG_XSLTPROC_ARGS) $(CHUNKED_XSLTPROC_ARGS) user-guide.xml
120 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
121 # you will get lot's of errors, but that's ok
122 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
124 @ echo --- WSUG - PDF US PAPER ---
125 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
128 # create pdf file (through XSL-FO), portrait pages on A4 paper
129 # you will get lot's of errors, but that's ok
130 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl
132 @ echo --- WSUG - PDF A4 PAPER ---
133 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
136 # create MS html help file (through html chunked pages)
137 user-guide.chm: $(WSUG_SOURCE)
139 @ echo --- WSUG - MICROSOFT HTML HELP ---
140 if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
141 -cp wsug_graphics/*.* wsug_chm/wsug_graphics
142 -cp common_graphics/*.* wsug_chm/wsug_graphics
143 -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar
144 $(XSLTPROC) --stringparam base.dir wsug_chm/ $(COMMON_XSLTPROC_ARGS) \
145 $(WSUG_XSLTPROC_ARGS) $(HTMLHELP_XSLTPROC_ARGS) user-guide.xml
146 -$(HHC_EXE) htmlhelp.hhp
152 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
153 if not exist wsluarm_src md wsluarm_src
154 $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
157 # -- Developer's Guide ------------------------------------------------------------------------
159 wsdg_x: wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
161 developer-guide.xml: developer-guide.asciidoc $(WSDG_FILES) wsluarm developer-guide-docinfo.xml
162 @ echo --- WSDG - XML ---
167 --attribute=docinfo \
168 --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
171 developer-guide.asciidoc
174 # validate the content
175 wsdg.validated: $(WSDG_SOURCE)
176 @ echo --- WSDG - VALIDATING XML ---
177 $(XMLLINT) --valid --noout developer-guide.xml
180 # create html single page file
181 wsdg_html: wsdg_html\index.html
183 wsdg_html\index.html: $(WSDG_SOURCE)
184 @ echo --- WSDG - HTML SINGLE PAGE ---
185 if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
186 if not exist wsdg_html\wsdg_graphics\toolbar md wsdg_html\wsdg_graphics\toolbar
187 cp wsdg_graphics/*.* wsdg_html/wsdg_graphics
188 cp common_graphics/*.* wsdg_html/wsdg_graphics
189 cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar
191 $(XSLTPROC) --stringparam base.dir wsdg_html/ $(COMMON_XSLTPROC_ARGS) \
192 $(WSDG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) developer-guide.xml > $@
194 # create html chunked page files
195 wsdg_html_chunked: wsdg_html_chunked\index.html
197 wsdg_html_chunked\index.html: $(WSDG_SOURCE)
198 @ echo --- WSDG - HTML CHUNKED ---
199 if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
200 if not exist wsdg_html_chunked\wsdg_graphics\toolbar md wsdg_html_chunked\wsdg_graphics\toolbar
201 cp wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics
202 cp common_graphics/*.* wsdg_html_chunked/wsdg_graphics
203 cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar
204 cp ws.css wsdg_html_chunked
205 $(XSLTPROC) --stringparam base.dir wsdg_html_chunked/ $(COMMON_XSLTPROC_ARGS) \
206 $(WSDG_XSLTPROC_ARGS) $(CHUNKED_XSLTPROC_ARGS) developer-guide.xml
208 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
209 # you will get lot's of errors, but that's ok
210 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
212 @ echo --- WSDG - PDF US PAPER ---
213 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
216 # create pdf file (through XSL-FO), portrait pages on A4 paper
217 # you will get lot's of errors, but that's ok
218 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
220 @ echo --- WSDG - PDF A4 PAPER ---
221 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
224 # create MS html help file (through html chunked pages)
225 developer-guide.chm: $(WSDG_SOURCE)
227 @ echo --- WSDG - MICROSOFT HTML HELP ---
228 if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
229 if not exist wsdg_chm\wsdg_graphics\toolbar md wsdg_chm\wsdg_graphics\toolbar
230 -cp wsdg_graphics/*.* wsdg_chm/wsdg_graphics
231 -cp common_graphics/*.* wsdg_chm/wsdg_graphics
232 -cp wsdg_graphics/toolbar/* wsdg_chm/wsdg_graphics/toolbar
233 $(XSLTPROC) --stringparam base.dir wsdg_chm/ $(COMMON_XSLTPROC_ARGS) \
234 $(WSDG_XSLTPROC_ARGS) $(HTMLHELP_XSLTPROC_ARGS) developer-guide.xml
235 -$(HHC_EXE) htmlhelp.hhp
241 # -- Release Notes ------------------------------------------------------------------------
243 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
245 # create html single page file
246 release-notes.html: $(RELEASE_NOTES_SOURCE)
247 @ echo --- RELEASE NOTES - HTML ---
251 $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
254 # create txt single page file (through HTML)
255 release-notes.txt: $(RELEASE_NOTES_SOURCE)
256 @ echo --- RELEASE NOTES - TXT ---
261 $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
262 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
263 release-notes.asciidoc
265 mv release-notes.text $@
267 news: release-notes.txt
268 copy release-notes.txt ..\NEWS
270 # create pdf file, portrait pages on US letter paper
271 release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
272 @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
276 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
277 --xsltproc-opts "--stringparam paper.type letter --nonet" \
278 --xsl-file=custom_layer_pdf.xsl \
279 release-notes.asciidoc
281 mv release-notes.pdf $@
283 # create pdf file, portrait pages on A4 paper
284 release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
285 @ echo --- RELEASE NOTES - PDF A4 PAPER ---
289 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
290 --xsltproc-opts "--stringparam paper.type A4 --nonet" \
291 --xsl-file=custom_layer_pdf.xsl \
292 release-notes.asciidoc
294 mv release-notes.pdf $@
296 _FORCE_: ## Assumption: no file named _FORCE_ exists in the current directory