sec_vt_bitmask
[metze/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 [target ...]
7 #
8 # $Id$
9 #
10
11 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
12
13 TOOLS_DIR=..\tools
14 include ..\config.nmake
15 include Makefile.common
16
17 WSUG_SOURCE          = $(WSUG_SOURCE)          Makefile.nmake
18 WSDG_SOURCE          = $(WSDG_SOURCE)          Makefile.nmake
19 RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
20
21 # Asciidoc converter
22 A2X_HTML_OPTS="--stylesheet=ws.css"
23 A2X_TEXT_OPTS=
24
25 !ifdef LYNX
26 A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
27 !endif
28
29 # Automatically generate .pdf files from .fo files
30 .fo.pdf:
31         $(FOP) $< $@
32
33 .SUFFIXES: .fo .pdf
34
35 # Convert an AsciiDoc document to a Docbook chapter
36 # .asciidoc -> whole book (.dbk) -> chapter (.xml)
37 .asciidoc.xml:
38         $(SH) <<
39         PATH=/usr/bin
40         $(A2X) --verbose \
41                 --asciidoc-opts="--conf-file=asciidoc.conf" \
42                 --no-xmllint \
43                 --format=docbook --doctype=book \
44                 $<
45 <<
46         mv $*.xml $*.dbk
47         xmllint --xpath "//chapter | //preface" $*.dbk > $@
48
49 .SUFFIXES: .asciidoc .xml
50
51 # -- (Public) targets -------------------------------------------------------
52
53 # Make all (default)
54 all: all_x
55
56 # Make only the WSUG
57 wsug: wsug.validated wsug_x
58
59 # Make only the WSDG
60 wsdg: wsdg.validated wsdg_x
61
62 # Make only the release notes
63 release_notes: $(RELEASE_NOTES_SOURCE)
64
65 # Clean all
66 clean:
67         rm -rf $(CLEANFILES) $(CLEANDIRS)
68
69 distclean: clean
70
71 maintainer-clean: distclean
72
73 # -- All -------------------------------------------------------------------------------
74
75 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
76
77 # -- Documentation version ------------------------------------------------------------------------
78
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
85
86 git_version.xml: git_version_check
87
88 # -- User Guide ------------------------------------------------------------------------
89
90 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
91
92 # validate the content
93 wsug.validated: $(WSUG_SOURCE) wsluarm
94         @ echo --- WSUG - VALIDATING XML ---
95         $(XMLLINT) --valid --noout user-guide.xml
96         touch $@
97
98 # create html single page file
99 wsug_html: wsug_html\index.html
100
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
106         cp ws.css wsug_html
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
109
110 # create html chunked page files
111 wsug_html_chunked: wsug_html_chunked\index.html
112
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
121
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
125 !ifdef FOP
126         @ echo --- WSUG - PDF US PAPER ---
127         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
128 !endif
129
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
133 !ifdef FOP
134         @ echo --- WSUG - PDF A4 PAPER ---
135         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
136 !endif
137
138 # create MS html help file (through html chunked pages)
139 user-guide.chm: $(WSUG_SOURCE) wsluarm
140 !ifdef HHC_EXE
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
147         -mv htmlhelp.chm $@
148         -rm -r htmlhelp.hhp
149         -rm -r toc.hhc
150 !endif
151
152 wsluarm: make-wsluarm.pl $(WSLUA_MODULES)
153         if not exist wsluarm_src md wsluarm_src
154         $(PERL) make-wsluarm.pl $(WSLUA_MODULES)
155         touch wsluarm
156
157 # -- Developer's Guide ------------------------------------------------------------------------
158
159 wsdg_x: wsdg_html_chunked wsdg_html developer-guide-a4.pdf developer-guide-us.pdf developer-guide.chm
160
161 # validate the content
162 wsdg.validated: $(WSDG_SOURCE)
163         @ echo --- WSDG - VALIDATING XML ---
164         $(XMLLINT) --valid --noout developer-guide.xml
165         touch $@
166
167 # create html single page file
168 wsdg_html: wsdg_html\index.html
169
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/
176         cp ws.css wsdg_html
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
179
180 # create html chunked page files
181 wsdg_html_chunked: wsdg_html_chunked\index.html
182
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
192
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
196 !ifdef FOP
197         @ echo --- WSDG - PDF US PAPER ---
198         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
199 !endif
200
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
204 !ifdef FOP
205         @ echo --- WSDG - PDF A4 PAPER ---
206         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
207 !endif
208
209 # create MS html help file (through html chunked pages)
210 developer-guide.chm: $(WSDG_SOURCE)
211 !ifdef HHC_EXE
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
219         -mv htmlhelp.chm $@
220         -rm -r htmlhelp.hhp
221         -rm -r toc.hhc
222 !endif
223
224 # -- Release Notes ------------------------------------------------------------------------
225
226 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
227
228 # create html single page file
229 release-notes.html: $(RELEASE_NOTES_SOURCE)
230         @ echo --- RELEASE NOTES - HTML ---
231         $(SH) <<
232         PATH=/usr/bin
233         $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
234 <<
235
236 # create txt single page file (through HTML)
237 release-notes.txt: $(RELEASE_NOTES_SOURCE)
238         @ echo --- RELEASE NOTES - TXT ---
239         $(SH) <<
240         PATH=/usr/bin
241         $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
242                 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
243                 release-notes.asciidoc
244 <<
245         mv release-notes.text $@
246
247 news: release-notes.txt
248         copy release-notes.txt ..\NEWS
249
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 ---
253         $(SH) <<
254         PATH=/usr/bin
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
259 <<
260         mv release-notes.pdf $@
261
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 ---
265         $(SH) <<
266         PATH=/usr/bin
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
271 <<
272         mv release-notes.pdf $@
273
274 _FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory
275