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 # Convert an AsciiDoc document to a Docbook chapter
36 # .asciidoc -> whole book (.dbk) -> chapter (.xml)
41 --asciidoc-opts="--conf-file=asciidoc.conf" \
43 --format=docbook --doctype=book \
47 xmllint --xpath "//chapter | //preface" $*.dbk > $@
49 .SUFFIXES: .asciidoc .xml
51 # -- (Public) targets -------------------------------------------------------
57 wsug: wsug.validated wsug_x
60 wsdg: wsdg.validated wsdg_x
62 # Make only the release notes
63 release_notes: $(RELEASE_NOTES_SOURCE)
67 rm -rf $(CLEANFILES) $(CLEANDIRS)
71 maintainer-clean: distclean
73 # -- All -------------------------------------------------------------------------------
75 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
77 # -- Documentation version ------------------------------------------------------------------------
79 # On every build, record the working copy revision string
80 # in git_version.xml (if the svn version has changed).
81 # This is done during nmake "preprocessing" so that it's done *before*
82 # nmake gets the date/time of the dependency file(s)].
83 git_version_check: _FORCE_
84 $(SH) ./check_git_version.sh
86 git_version.xml: git_version_check
88 # -- User Guide ------------------------------------------------------------------------
90 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
92 # validate the content
93 wsug.validated: $(WSUG_SOURCE) wsluarm
94 @ echo --- WSUG - VALIDATING XML ---
95 $(XMLLINT) --valid --noout user-guide.xml
98 # create html single page file
99 wsug_html: wsug_html\index.html
101 wsug_html\index.html: $(WSUG_SOURCE) wsluarm
102 @ echo --- WSUG - HTML SINGLE PAGE ---
103 if not exist wsug_html\wsug_graphics\toolbar md wsug_html\wsug_graphics\toolbar
104 cp wsug_graphics/*.* wsug_html/wsug_graphics
105 cp wsug_graphics/toolbar/* wsug_html/wsug_graphics/toolbar
107 $(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 > $@
108 -chmod -R og+rX wsug_html
110 # create html chunked page files
111 wsug_html_chunked: wsug_html_chunked\index.html
113 wsug_html_chunked\index.html: $(WSUG_SOURCE) wsluarm
114 @ echo --- WSUG - HTML CHUNKED ---
115 if not exist wsug_html_chunked\wsug_graphics\toolbar md wsug_html_chunked\wsug_graphics\toolbar
116 cp wsug_graphics/*.* wsug_html_chunked/wsug_graphics
117 cp wsug_graphics/toolbar/* wsug_html_chunked/wsug_graphics/toolbar
118 cp ws.css wsug_html_chunked
119 $(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
120 -chmod -R og+rX wsug_html_chunked
122 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
123 # you will get lot's of errors, but that's ok
124 user-guide-us.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
126 @ echo --- WSUG - PDF US PAPER ---
127 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
130 # create pdf file (through XSL-FO), portrait pages on A4 paper
131 # you will get lot's of errors, but that's ok
132 user-guide-a4.fo: $(WSUG_SOURCE) custom_layer_pdf.xsl wsluarm
134 @ echo --- WSUG - PDF A4 PAPER ---
135 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
138 # create MS html help file (through html chunked pages)
139 user-guide.chm: $(WSUG_SOURCE) wsluarm
141 @ echo --- WSUG - MICROSOFT HTML HELP ---
142 if not exist wsug_chm\wsug_graphics\toolbar md wsug_chm\wsug_graphics\toolbar
143 -cp wsug_graphics/*.* wsug_chm/wsug_graphics/
144 -cp wsug_graphics/toolbar/* wsug_chm/wsug_graphics/toolbar/
145 $(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
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 # validate the content
162 wsdg.validated: $(WSDG_SOURCE)
163 @ echo --- WSDG - VALIDATING XML ---
164 $(XMLLINT) --valid --noout developer-guide.xml
167 # create html single page file
168 wsdg_html: wsdg_html\index.html
170 wsdg_html\index.html: $(WSDG_SOURCE)
171 @ echo --- WSDG - HTML SINGLE PAGE ---
172 if not exist wsdg_html\wsdg_graphics md wsdg_html\wsdg_graphics
173 if not exist wsdg_html\wsdg_graphics\toolbar md wsdg_html\wsdg_graphics\toolbar
174 cp wsdg_graphics/*.* wsdg_html/wsdg_graphics/
175 cp wsdg_graphics/toolbar/* wsdg_html/wsdg_graphics/toolbar/
177 $(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 > $@
178 -chmod -R og+rX wsdg_html
180 # create html chunked page files
181 wsdg_html_chunked: wsdg_html_chunked\index.html
183 wsdg_html_chunked\index.html: $(WSDG_SOURCE)
184 @ echo --- WSDG - HTML CHUNKED ---
185 if not exist wsdg_html_chunked\wsdg_graphics md wsdg_html_chunked\wsdg_graphics
186 if not exist wsdg_html_chunked\wsdg_graphics\toolbar md wsdg_html_chunked\wsdg_graphics\toolbar
187 cp wsdg_graphics/*.* wsdg_html_chunked/wsdg_graphics/
188 cp wsdg_graphics/toolbar/* wsdg_html_chunked/wsdg_graphics/toolbar/
189 cp ws.css wsdg_html_chunked
190 $(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
191 -chmod -R og+rX wsdg_html_chunked
193 # create pdf file (through XSL-FO), portrait pages on US letter paper (the default)
194 # you will get lot's of errors, but that's ok
195 developer-guide-us.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
197 @ echo --- WSDG - PDF US PAPER ---
198 $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
201 # create pdf file (through XSL-FO), portrait pages on A4 paper
202 # you will get lot's of errors, but that's ok
203 developer-guide-a4.fo: $(WSDG_SOURCE) custom_layer_pdf.xsl
205 @ echo --- WSDG - PDF A4 PAPER ---
206 $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
209 # create MS html help file (through html chunked pages)
210 developer-guide.chm: $(WSDG_SOURCE)
212 @ echo --- WSDG - MICROSOFT HTML HELP ---
213 if not exist wsdg_chm\wsdg_graphics md wsdg_chm\wsdg_graphics
214 if not exist wsdg_chm\wsdg_graphics\toolbar md wsdg_chm\wsdg_graphics\toolbar
215 cp wsdg_graphics/*.* wsdg_chm/wsdg_graphics/
216 cp wsdg_graphics/toolbar/* wsdg_chm/wsdg_graphics/toolbar/
217 $(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
218 -$(HHC_EXE) htmlhelp.hhp
224 # -- Release Notes ------------------------------------------------------------------------
226 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
228 # create html single page file
229 release-notes.html: $(RELEASE_NOTES_SOURCE)
230 @ echo --- RELEASE NOTES - HTML ---
233 $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
236 # create txt single page file (through HTML)
237 release-notes.txt: $(RELEASE_NOTES_SOURCE)
238 @ echo --- RELEASE NOTES - TXT ---
241 $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
242 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
243 release-notes.asciidoc
245 mv release-notes.text $@
247 news: release-notes.txt
248 copy release-notes.txt ..\NEWS
250 # create pdf file, portrait pages on US letter paper
251 release-notes-us.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
252 @ echo --- RELEASE NOTES - PDF US LETTER PAPER ---
255 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
256 --xsltproc-opts "--stringparam paper.type letter --nonet" \
257 --xsl-file=custom_layer_pdf.xsl \
258 release-notes.asciidoc
260 mv release-notes.pdf $@
262 # create pdf file, portrait pages on A4 paper
263 release-notes-a4.pdf: $(RELEASE_NOTES_SOURCE) custom_layer_pdf.xsl
264 @ echo --- RELEASE NOTES - PDF A4 PAPER ---
267 $(A2X) --format=pdf $(A2X_HTML_OPTS) \
268 --xsltproc-opts "--stringparam paper.type A4 --nonet" \
269 --xsl-file=custom_layer_pdf.xsl \
270 release-notes.asciidoc
272 mv release-notes.pdf $@
274 _FORCE_: ## Assumption: no file named _FORCE_ exists in the current directory