Add the profile name to the Coloring Rules window title.
[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
9 ############### YOU SHOULDN'T HAVE TO EDIT ANYTHING BELOW THIS LINE! ################
10
11 TOOLS_DIR=..\tools
12 include ..\config.nmake
13 top_srcdir=..
14 include Makefile.common
15
16 WSUG_SOURCE          = $(WSUG_SOURCE)          Makefile.nmake
17 WSDG_SOURCE          = $(WSDG_SOURCE)          Makefile.nmake
18 RELEASE_NOTES_SOURCE = $(RELEASE_NOTES_SOURCE) Makefile.nmake
19
20 # Asciidoc converter
21 A2X_HTML_OPTS="--stylesheet=ws.css"
22 A2X_TEXT_OPTS=
23
24 !ifdef LYNX
25 A2X_TEXT_OPTS=$(A2X_TEXT_OPTS) --lynx
26 !endif
27
28 # Automatically generate .pdf files from .fo files
29 .fo.pdf:
30         $(FOP) $< $@
31
32 .SUFFIXES: .fo .pdf
33
34 # -- (Public) targets -------------------------------------------------------
35
36 # Make all (default)
37 all: all_x
38
39 # Make only the WSUG
40 wsug: wsug.validated wsug_x
41
42 # Make only the WSDG
43 wsdg: wsdg.validated wsdg_x
44
45 # Make only the release notes
46 release_notes: release_notes_x
47
48 # Clean all
49 clean:
50         rm -rf $(CLEANFILES) $(CLEANDIRS)
51
52 distclean: clean
53
54 maintainer-clean: distclean
55
56 # -- All -------------------------------------------------------------------------------
57
58 all_x: wsug.validated wsdg.validated wsug_x wsdg_x release_notes_x
59
60 # -- Documentation version ------------------------------------------------------------------------
61
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
68
69 git_version.xml: git_version_check
70
71 # -- User Guide ------------------------------------------------------------------------
72
73 wsug_x: wsug_html_chunked wsug_html user-guide-a4.pdf user-guide-us.pdf user-guide.chm
74
75 user-guide.xml: user-guide.asciidoc $(WSUG_FILES) user-guide-docinfo.xml
76         @ echo --- WSUG - XML ---
77         $(SH) <<
78         PATH=/usr/bin
79         PYTHONHOME=/
80         $(A2X) --verbose \
81                 --attribute=docinfo \
82                 --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
83                 --no-xmllint \
84                 --format=docbook \
85                 user-guide.asciidoc
86 <<
87
88 # validate the content
89 wsug.validated: $(WSUG_SOURCE)
90         @ echo --- WSUG - VALIDATING XML ---
91         $(XMLLINT) --valid --noout user-guide.xml
92         touch $@
93
94 # create html single page file
95 wsug_html: wsug_html\index.html
96
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
103         cp ws.css wsug_html
104         $(XSLTPROC) --stringparam base.dir wsug_html/ $(COMMON_XSLTPROC_ARGS) \
105                 $(WSUG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) user-guide.xml > $@
106
107 # create html chunked page files
108 wsug_html_chunked: wsug_html_chunked\index.html
109
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
119
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
123 !ifdef FOP
124         @ echo --- WSUG - PDF US PAPER ---
125         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl user-guide.xml > $@
126 !endif
127
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
131 !ifdef FOP
132         @ echo --- WSUG - PDF A4 PAPER ---
133         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl user-guide.xml > $@
134 !endif
135
136 # create MS html help file (through html chunked pages)
137 user-guide.chm: $(WSUG_SOURCE)
138 !ifdef HHC_EXE
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
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 developer-guide.xml: developer-guide.asciidoc $(WSDG_FILES) wsluarm developer-guide-docinfo.xml
162         @ echo --- WSDG - XML ---
163         $(SH) <<
164         PATH=/usr/bin
165         PYTHONHOME=/
166         $(A2X) --verbose \
167                 --attribute=docinfo \
168                 --asciidoc-opts="--conf-file=asciidoc.conf --conf-file=asciidoctor-asciidoc.conf" \
169                 --no-xmllint \
170                 --format=docbook \
171                 developer-guide.asciidoc
172 <<
173
174 # validate the content
175 wsdg.validated: $(WSDG_SOURCE)
176         @ echo --- WSDG - VALIDATING XML ---
177         $(XMLLINT) --valid --noout developer-guide.xml
178         touch $@
179
180 # create html single page file
181 wsdg_html: wsdg_html\index.html
182
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
190         cp ws.css wsdg_html
191         $(XSLTPROC) --stringparam base.dir wsdg_html/ $(COMMON_XSLTPROC_ARGS) \
192                 $(WSDG_XSLTPROC_ARGS) $(SINGLE_XSLTPROC_ARGS) developer-guide.xml > $@
193
194 # create html chunked page files
195 wsdg_html_chunked: wsdg_html_chunked\index.html
196
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
207
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
211 !ifdef FOP
212         @ echo --- WSDG - PDF US PAPER ---
213         $(XSLTPROC) --stringparam paper.type letter --nonet custom_layer_pdf.xsl developer-guide.xml > $@
214 !endif
215
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
219 !ifdef FOP
220         @ echo --- WSDG - PDF A4 PAPER ---
221         $(XSLTPROC) --stringparam paper.type A4 --nonet custom_layer_pdf.xsl developer-guide.xml > $@
222 !endif
223
224 # create MS html help file (through html chunked pages)
225 developer-guide.chm: $(WSDG_SOURCE)
226 !ifdef HHC_EXE
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
236         -mv htmlhelp.chm $@
237         -rm -r htmlhelp.hhp
238         -rm -r toc.hhc
239 !endif
240
241 # -- Release Notes ------------------------------------------------------------------------
242
243 release_notes_x: release-notes.html release-notes.txt release-notes-a4.pdf release-notes-us.pdf
244
245 # create html single page file
246 release-notes.html: $(RELEASE_NOTES_SOURCE)
247         @ echo --- RELEASE NOTES - HTML ---
248         $(SH) <<
249         PATH=/usr/bin
250         PYTHONHOME=/
251         $(A2X) -v --format=xhtml $(A2X_HTML_OPTS) release-notes.asciidoc
252 <<
253
254 # create txt single page file (through HTML)
255 release-notes.txt: $(RELEASE_NOTES_SOURCE)
256         @ echo --- RELEASE NOTES - TXT ---
257         $(SH) <<
258         PATH=/usr/bin
259         PYTHONHOME=/
260         TZ=UTC
261         $(A2X) -v --format=text $(A2X_TEXT_OPTS) \
262                 --xsltproc-opts "--stringparam generate.toc \"article nop\"" \
263                 release-notes.asciidoc
264 <<
265         mv release-notes.text $@
266
267 news: release-notes.txt
268         copy release-notes.txt ..\NEWS
269
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 ---
273         $(SH) <<
274         PATH=/usr/bin
275         PYTHONHOME=/
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
280 <<
281         mv release-notes.pdf $@
282
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 ---
286         $(SH) <<
287         PATH=/usr/bin
288         PYTHONHOME=/
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
293 <<
294         mv release-notes.pdf $@
295
296 _FORCE_:  ## Assumption: no file named _FORCE_ exists in the current directory