VirtualBox

source: vbox/trunk/doc/manual/Makefile.kmk@ 56545

Last change on this file since 56545 was 56544, checked in by vboxsync, 10 years ago

Use xi:include instead of SED for including SDKRef_apiref.xml into SDKRef.xml.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 46.7 KB
Line 
1# $Id: Makefile.kmk 56544 2015-06-18 20:39:03Z vboxsync $
2## @file
3# Sub-Makefile for the VBox User Manual.
4#
5
6#
7# Copyright (C) 2006-2015 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18#
19# This slightly messy makefile transforms the DocBook XML source for the
20# user manual into presentation output. We support two targets:
21#
22# -- UserManual.pdf, generated by LaTex
23#
24# -- VirtualBox.chm
25#
26# Both files end up in PATH_STAGE_BIN.
27#
28# Both targets indirectly depend on the XML files in this directory;
29# "indirectly" because we first copy them to PATH_TARGET and hack them
30# up a bit for variable substitution and such (see below).
31# The toolchains are roughly like this:
32#
33# -- PDF file via Apache FOP: pre-process the XML files in PATH_TARGET,
34# then create a .FO file (another XML format for "formatted objects")
35# via xsltproc, then feed the .FO file to Apache FOP to create the PDF.
36#
37# -- PDF file via LaTeX: pre-process the XML files in PATH_TARGET, then
38# run our custom "dblatex" perl script on UserManual.xml, which parses
39# the XML (using the Perl SAX parsers) and dumps a matching latex file
40# to UserManual.tex. This is then regularly processed by pdflatex to
41# generate PDF.
42#
43# -- CHM file: again, pre-process the XML files in PATH_TARGET, then use
44# xsltproc to create a .HHP file for the Microsoft Help Compiler, then
45# feed that file to it.
46#
47
48SUB_DEPTH = ../..
49include $(KBUILD_PATH)/subheader.kmk
50
51
52#
53# Globals
54#
55
56# Error out if someone tries to override old globals.
57ifdef HTMLHELPOPTS
58 $(error HTMLHELPOPTS was renamed to VBOX_HTMLHELP_OPTS!)
59endif
60ifdef DOCBOOKPATH
61 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
62endif
63ifdef DOCBOOKPATH
64 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
65endif
66ifdef XML_CATALOG
67 $(error XML_CATALOG was renamed to VBOX_XML_CATALOG!)
68endif
69ifdef VBOX_XML_CATALOG_DOCBOOK
70 $(error XML_CATALOG_DOCBOOK was renamed to VBOX_XML_CATALOG_DOCBOOK!)
71endif
72ifdef VBOXMANAGEPATH
73 $(error VBOXMANAGEPATH was renamed to VBOXMANAGEHELP_PATH!)
74endif
75ifdef PDFLATEX_INTERACTION
76 $(error PDFLATEX_INTERACTION was renamed to VBOX_PDFLATEX_INTERACTION!)
77endif
78ifdef PDFLATEX
79 $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
80endif
81ifdef HHC
82 $(error HHC was renamed to VBOX_HHC!)
83endif
84
85# Source and output locations.
86VBOX_PATH_MANUAL_SRC := $(PATH_SUB_CURRENT)
87VBOX_PATH_MANUAL_OUTBASE := $(PATH_TARGET)/manual
88
89# tool locations
90ifndef VBOX_OSE
91 # use docbook from our tools directory
92 VBOX_PATH_DOCBOOK ?= $(PATH_DEVTOOLS)/common/DocBook/v1.69.1
93 VBOX_PATH_DOCBOOK_DTD ?= $(PATH_DEVTOOLS)/common/docbook-xml/v4.3
94 VBOX_XML_CATALOG ?= $(VBOX_PATH_MANUAL_OUTBASE)/catalog
95 VBOX_XML_CATALOG_DOCBOOK ?= $(VBOX_PATH_MANUAL_OUTBASE)/docbook
96else
97 # use docbook of the build host
98 VBOX_PATH_DOCBOOK ?= http://docbook.sourceforge.net/release/xsl/current/
99endif
100
101# xsltproc with the catalog trick if applicable.
102ifdef VBOX_XML_CATALOG
103 VBOX_XSLTPROC_WITH_CAT = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
104 $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
105 VBOX_XMLLINT_WITH_CAT = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
106 $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
107else
108 VBOX_XSLTPROC_WITH_CAT = $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
109 VBOX_XMLLINT_WITH_CAT = $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
110endif
111
112VBOXMANAGEHELP_PATH ?= $(PATH_STAGE_BIN)/VBoxManageHelp$(SUFF_EXE)
113
114 # VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
115 # without catting the log a million times.
116VBOX_PDFLATEX_INTERACTION ?= batchmode
117ifeq ($(KBUILD_HOST),win)
118 ifndef VBOX_PDFLATEX
119 VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
120 ifneq ($(VBOX_PDFLATEX),)
121 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
122 endif
123 endif
124 ifndef VBOX_PDFLATEX
125 # Tell MiKTeX to automatically download packages if system wide install.
126 VBOX_PDFLATEX := pdflatex
127 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
128 endif
129else
130 VBOX_PDFLATEX ?= pdflatex
131 VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
132 VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
133endif
134
135# Windows HTML Help Workshop compiler (stupid thing always returns an error!)
136VBOX_HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
137
138
139# Additional xsltproc options when generating
140VBOX_HTMLHELP_OPTS ?=
141
142# SDK related globals.
143VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
144VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
145VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
146
147##
148# Non-pattern-rule approach to editing XSLT files.
149# $(evalcall2 def_vbox_replace_paths_in_xslt)
150# @param 1 The XSLT source file (relative to Makefile dir).
151# @param 2 Optional output subdirectory (leading slash).
152define def_vbox_replace_paths_in_xslt
153OTHER_CLEAN += $$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1)
154$$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1): $$(VBOX_PATH_MANUAL_SRC)/$1 | $$$$(dir $$$$@)
155 $$(call MSG_L1,Pre-processing $$(<) to $$(@))
156 $$(QUIET)$$(SED) \
157 -e 's|@VBOX_PATH_DOCBOOK@|$$(VBOX_PATH_DOCBOOK)|g' \
158 -e 's|@VBOX_PATH_MANUAL_SRC@|$$(VBOX_PATH_MANUAL_SRC)|g' \
159 -e 's|@VBOX_PATH_MANUAL_OUTBASE@|$$(VBOX_PATH_MANUAL_OUTBASE)|g' \
160 -e 's|@VBOX_PATH_MANUAL_OUT_LANG@|$$(VBOX_PATH_MANUAL_OUTBASE)$2|g' \
161 --output "$$(@)" $$<
162endef
163
164##
165# Non-pattern-rule approach to editing XML files.
166# $(evalcall2 def_vbox_replace_stuff_in_xml)
167# @param 1 The XSLT source file (relative to Makefile dir).
168# @param 2 Optional output subdirectory (leading slash).
169#
170define def_vbox_replace_stuff_in_xml
171OTHER_CLEAN += $$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1)
172$$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1): $$(VBOX_PATH_MANUAL_SRC)/$1 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
173 $$(call MSG_L1,Pre-processing $$(<) to $$(@))
174 $$(QUIET)$$(SED) \
175 -e 's|@VBOX_PATH_DOCBOOK@|$$(VBOX_PATH_DOCBOOK)|g' \
176 -e 's|@VBOX_PATH_MANUAL_SRC@|$$(VBOX_PATH_MANUAL_SRC)|g' \
177 -e 's|@VBOX_PATH_MANUAL_OUTBASE@|$$(VBOX_PATH_MANUAL_OUTBASE)|g' \
178 -e 's|@VBOX_PATH_MANUAL_OUT_LANG@|$$(VBOX_PATH_MANUAL_OUTBASE)$2|g' \
179 \
180 -e 's/@VBOX_VERSION_MAJOR@/$$(VBOX_VERSION_MAJOR)/g' \
181 -e 's/@VBOX_VERSION_MINOR@/$$(VBOX_VERSION_MINOR)/g' \
182 -e 's/@VBOX_VERSION_BUILD@/$$(VBOX_VERSION_BUILD)/g' \
183 -e 's/@VBOX_VERSION_STRING@/$$(VBOX_VERSION_STRING)/g' \
184 -e 's/@VBOX_VENDOR@/$$(VBOX_VENDOR)/g' \
185 -e 's/@VBOX_PRODUCT@/$$(VBOX_PRODUCT)/g' \
186 -e 's/@VBOX_C_YEAR@/$$(VBOX_C_YEAR)/g' \
187 \
188 --output "$$(@)" $$<
189endef
190
191## List of refentry files (manpages).
192VBOX_MANUAL_XML_REFENTRY_FILES = \
193 man_VBoxManage-debugvm.xml \
194 man_VBoxManage-extpack.xml
195
196
197#
198# Targets
199#
200
201BLDDIRS += $(VBOX_PATH_MANUAL_OUTBASE) $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
202
203
204if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
205 if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
206 ## @todo make this an install target, drop the BLDDIRS.
207 OTHERS += \
208 $(VBOX_PATH_SDK)/docs/SDKRef.pdf
209 BLDDIRS += \
210 $(VBOX_PATH_SDK)/docs
211 endif
212
213 ifdef VBOX_WITH_DOCS_CHM
214 VBOX_PATH_BIN_CHM = $(PATH_STAGE_BIN)/VirtualBox.chm
215 else # Do not build chm.
216 VBOX_PATH_BIN_CHM =
217 endif
218
219 ifndef VBOX_ONLY_SDK
220 VBOX_MANUAL_PACK += \
221 $(PATH_STAGE_BIN)/UserManual.pdf \
222 $(VBOX_PATH_BIN_CHM)
223 OTHERS += \
224 $(PATH_STAGE_BIN)/UserManual.pdf
225 OTHERS.win += \
226 $(VBOX_PATH_BIN_CHM)
227 OTHERS.linux += \
228 $(VBOX_PATH_BIN_CHM)
229
230 ifdef VBOX_WITH_DOCS_TRANSLATIONS
231 OTHERS += \
232 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
233 ifdef VBOX_WITH_DOCS_CHM
234 OTHERS.win += \
235 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
236 OTHERS.linux += \
237 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
238 endif
239 endif
240 endif # !VBOX_ONLY_SDK
241 ifdef VBOX_ONLY_DOCS
242 PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
243 endif
244
245 ifdef VBOX_WITH_DOCS_TRANSLATIONS
246 VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
247 endif
248
249 VBOX_MANUAL_XML_CHANGELOG = \
250 user_ChangeLogImpl.xml
251
252 VBOX_MANUAL_XML_FILES = \
253 UserManual.xml \
254 user_AdvancedTopics.xml \
255 user_BasicConcepts.xml \
256 user_Glossary.xml \
257 user_Frontends.xml \
258 user_Installation.xml \
259 user_GuestAdditions.xml \
260 user_Introduction.xml \
261 user_KnownIssues.xml \
262 user_PrivacyPolicy.xml \
263 user_Security.xml \
264 user_Technical.xml \
265 user_ThirdParty.xml \
266 user_Troubleshooting.xml \
267 user_VBoxManage.xml \
268 user_VirtualBoxAPI.xml \
269 user_Storage.xml \
270 user_Networking.xml
271
272 VBOX_MANUAL_XML_FILES_INCL_CHANGELOG = $(VBOX_MANUAL_XML_FILES) \
273 user_ChangeLog.xml
274
275 VBOX_SDKREF_XML_FILES = \
276 SDKRef.xml
277
278 # Wildcard the images path for every supported language
279 $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
280 $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
281
282 VBOX_MANUAL_TEX_UNICODE_FILES = \
283 $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
284
285 VBOX_MANUAL_LATEX_FILES_TARGET = \
286 $(addprefix UserManual.,aux log out toc tex)
287
288 VBOX_SDKREF_LATEX_FILES_TARGET = \
289 $(addprefix SDKRef.,aux log out toc tex)
290
291 BLDDIRS += \
292 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/,\
293 $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
294 $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
295 $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
296 $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
297 $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
298 )
299
300 ifdef VBOX_WITH_DOCS_CHM
301 VBOX_MANUAL_PACK += \
302 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf $(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
303 endif
304
305 OTHER_CLEAN += \
306 $(VBOX_XML_CATALOG) \
307 $(VBOX_XML_CATALOG_DOCBOOK) \
308 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
309 $(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG) \
310 $(VBOX_MANUAL_XML_REFENTRY_FILES) \
311 $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
312 $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
313 $(VBOX_MANUAL_LATEX_FILES_TARGET) \
314 $(VBOX_MANUAL_PNG_FILES_$(lang)) \
315 $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
316 $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
317 html-single/UserManual.html \
318 $(addprefix HTMLHelp/, index.html go01.html) \
319 $(addprefix html-chunks/, index.html go01.html) \
320 $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
321 ,html-chunks/ch$(n).html \
322 html-chunks/re$(n).html \
323 HTMLHelp/ch$(n).html \
324 HTMLHelp/re$(n).html \
325 $(foreach d2,0 1 2 3 4 5 6 7 8 9,$(foreach d1,0 1 2 3 4 5 6 7 8 9,HTMLHelp/ch$(n)s$(d2)$(d1).html)) ) \
326 $(foreach n,a b c \
327 ,html-chunks/ap$(n).html \
328 HTMLHelp/ap$(n).html \
329 $(foreach s,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20,HTMLHelp/ap$(n)s$(s).html) ) \
330 HTMLHelp/toc.hhc \
331 HTMLHelp/htmlhelp.hhp \
332 titlepage-htmlhelp.xsl \
333 UserManual.pdf \
334 VirtualBox.chm \
335 ChangeLog.html \
336 validatemanual.run \
337 )) \
338 $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG) \
339 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
340 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
341 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
342 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
343 $(PATH_STAGE_BIN)/UserManual.pdf \
344 $(PATH_STAGE_BIN)/VirtualBox.chm \
345 \
346 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
347 $(VBOX_SDKREF_XML_FILES) \
348 $(VBOX_SDKREF_LATEX_FILES_TARGET) \
349 SDKRef.pdf \
350 ) \
351 $(VBOX_DOC_XIDL_SRC_TMP) \
352 $(VBOX_MANUAL_APIREF_TMP) \
353 $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
354
355endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
356
357
358
359#
360# To avoid network I/O for fetching DTDs, we generate catalogs mapping the public
361# entity IDs to local files. (Obviously, only done when we have local files.)
362#
363ifdef VBOX_XML_CATALOG
364# Create a catalog file for xsltproc that points to docbook catalog.
365$(VBOX_XML_CATALOG): $(MAKEFILE_CURRENT) | $$(dir $$@)
366 $(call MSG_L1,Creating catalog $@)
367 $(QUIET)$(RM) -f [email protected] $@
368 $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
369 $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
370 $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
371 $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/ENTITIES DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
372 $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/DTD DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
373 $(QUIET)$(APPEND) [email protected] ' <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
374 $(QUIET)$(APPEND) [email protected] ' <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
375 $(QUIET)$(APPEND) [email protected] '</catalog>'
376 $(QUIET)$(MV) -f [email protected] $@
377
378# Create a docbook catalog file for xsltproc that points to the local docbook files.
379$(VBOX_XML_CATALOG_DOCBOOK): $(MAKEFILE_CURRENT) | $$(dir $$@)
380 $(call MSG_L1,Creating catalog $@)
381 $(QUIET)$(RM) -f [email protected] $@
382 $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
383 $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
384 $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
385 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbpoolx.mod"/>'
386 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
387 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.4//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
388 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Character Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbcentx.mod"/>'
389 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Notations V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbnotnx.mod"/>'
390 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Additional General Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbgenent.mod"/>'
391 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbhierx.mod"/>'
392 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/soextblx.dtd"/>'
393 $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML CALS Table Model V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/calstblx.dtd"/>'
394 $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
395 $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
396 $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
397 $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
398 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsa.ent"/>'
399 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsb.ent"/>'
400 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsc.ent"/>'
401 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsn.ent"/>'
402 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amso.ent"/>'
403 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsr.ent"/>'
404 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-box.ent"/>'
405 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr1.ent"/>'
406 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr2.ent"/>'
407 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-dia.ent"/>'
408 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk1.ent"/>'
409 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk2.ent"/>'
410 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk3.ent"/>'
411 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk4.ent"/>'
412 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat1.ent"/>'
413 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat2.ent"/>'
414 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-num.ent"/>'
415 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Publishing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-pub.ent"/>'
416 $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES General Technical//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-tech.ent"/>'
417 $(QUIET)$(APPEND) [email protected] '</catalog>'
418 $(QUIET)$(MV) -f [email protected] $@
419endif
420
421
422if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
423
424
425##########################################################################################
426#
427# Rules: Preprocess DocBook XML files
428# (preliminary step for both CHM and PDF generation)
429#
430##########################################################################################
431
432#
433# The following rules for $(VBOX_PATH_MANUAL_OUTBASE)/*.xml process the XML files
434# in doc/manual to allow for some magic variable replacements. The PDF and CHM
435# targets do not depend on the XML files in doc/manual, but those in
436# $(VBOX_PATH_MANUAL_OUTBASE) instead, which we copy there from here, after that magic
437# processing.
438#
439# So, before copying, the following steps are performed:
440#
441# -- $VBOX_VERSION_* strings are replaced with the actual current VBox version.
442# -- $VBOX_MANAGE_OUTPUT (in VBoxManage.xml) is replaced with the current
443# output of the actual VBoxManage program, to save us from having to
444# update the manual all the time.
445#
446
447# Only one changelog for all languages
448# $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG): $(VBOX_PATH_MANUAL_SRC)/$(VBOX_MANUAL_XML_CHANGELOG) | $$(dir $$@)
449# $(QUIET)$(INSTALL) -m 0644 $< $@
450
451# Manual dependency on user_ChangeLogImpl.xml
452$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
453,$(eval $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_ChangeLog.xml: $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml))
454
455# intermediate step to do some variable replacement in the document
456$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
457,$(foreach file,$(filter-out user_VBoxManage.xml,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
458,$(evalcall2 def_vbox_replace_stuff_in_xml,/$(lang)/$(file),/$(lang))))
459
460# TODO: figure why the rule below doesn't cause kmk to rebuild the manual when a man page changes!
461$(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
462$(eval $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_VBoxManage.xml: $(VBOX_PATH_MANUAL_SRC)/$(lang)/user_VBoxManage.xml \
463 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
464 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
465 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml ))
466
467# user_VBoxManage.xml currently needs some extra processing to stitch in the VBoxManage usage blob.
468$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_VBoxManage.xml): \
469 $(VBOX_PATH_MANUAL_OUTBASE)/% : \
470 $(VBOX_PATH_MANUAL_SRC)/% \
471 $$(addprefix $$(@D)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
472 $$(addprefix $$(@D)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
473 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
474 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
475 $(VBOXMANAGEHELP_PATH) | $$(dir $$@)
476 $(call MSG_L1,Pre-processing [2] $(@F) to $@)
477 $(QUIET)$(RM) -f $@ [email protected] [email protected]
478 $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
479 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
480 -- \
481 $(VBOXMANAGEHELP_PATH) --dumpopts
482 $(QUIET)$(SED) \
483 -e ':a' \
484 -e 'N' \
485 -e '$(DOLLAR)!ba' \
486 -e 's/</\&lt\;/g' \
487 -e 's/>/\&gt\;/g' \
488 -e 's/\n*$(DOLLAR)/<\/screen>/' \
489 -e 's/^/<screen>/' \
490 --output [email protected] [email protected]
491 $(QUIET)$(SED) \
492 -e '/@VBOX_MANAGE_OUTPUT@/{' -e 'r [email protected]' -e 'd' -e '}' \
493 \
494 -e 's/@VBOX_VERSION_MAJOR@/$(VBOX_VERSION_MAJOR)/g' \
495 -e 's/@VBOX_VERSION_MINOR@/$(VBOX_VERSION_MINOR)/g' \
496 -e 's/@VBOX_VERSION_BUILD@/$(VBOX_VERSION_BUILD)/g' \
497 -e 's/@VBOX_VERSION_STRING@/$(VBOX_VERSION_STRING)/g' \
498 -e 's/@VBOX_VENDOR@/$(VBOX_VENDOR)/g' \
499 -e 's/@VBOX_PRODUCT@/$(VBOX_PRODUCT)/g' \
500 -e 's/@VBOX_C_YEAR@/$(VBOX_C_YEAR)/g' \
501 -e 's|@VBOX_PATH_DOCBOOK@|$(VBOX_PATH_DOCBOOK)|g' \
502 -e 's|@VBOX_PATH_MANUAL_SRC@|$(VBOX_PATH_MANUAL_SRC)|g' \
503 --output "$@" \
504 "$<"
505 $(QUIET)$(RM) -f [email protected] [email protected]
506
507##
508# Morph man pages into manual sections.
509# $(evalcall2 def_vbox_refentry_to_user_sect1)
510# @param 1 The XSLT source file (relative to Makefile dir).
511# @param 2 Optional output subdirectory.
512define def_vbox_refentry_to_user_sect1
513$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): \
514 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
515 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
516 $$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
517 $$(VBOX_VERSION_STAMP) | $$(dir $$@)
518 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(filter %.xml,$$^),$$@)
519 $$(QUIET)$$(RM) -f "$$@"
520 $$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
521endef
522$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
523, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file))))
524
525
526# Generates the VBoxManage command overview include file (shared between
527# languages) from the refsynopsisdiv section of the man pages.
528$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
529 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
530 $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
531 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
532 | $$(dir $$@)
533 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
534 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
535
536$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(MAKEFILE_CURRENT) | $$(dir $$@)
537 $(call MSG_GENERATE,,$@,)
538 $(QUIET)$(APPEND) -tn "$@" \
539 '<?xml version="1.0" encoding="UTF-8"?>' \
540 '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">' \
541 '<remark role="VBoxManage-overview">' \
542 $(foreach refentry, $(filter man_VBoxManage%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
543 , ' <xi:include href="overview_$(refentry)" xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />') \
544 '</remark>'
545
546
547
548
549##########################################################################################
550#
551# Shared rules for PDF generation
552#
553##########################################################################################
554
555ifndef VBOX_OSE
556# copy ucs.sty and related files
557$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
558 $(call MSG_L1,Copying unicode support for LaTeX)
559 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
560endif
561
562# copy the PNG files.
563# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
564define def_vbox_cp_images_pdf
565local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
566$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
567 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
568 $$(call MSG_L1,Copying temporary $$< => $$@)
569 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
570endef
571
572$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
573
574
575##########################################################################################
576#
577# UserManual.pdf
578#
579##########################################################################################
580
581## @todo INSTALLS target for this!
582$(PATH_STAGE_BIN)/UserManual.pdf: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf | $$(dir $$@)
583 $(QUIET)$(CP) $< $@
584 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
585
586$(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf): \
587 $(PATH_STAGE_BIN)/UserManual_%.pdf : $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf
588 $(QUIET)$(CP) $< $@
589 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
590
591$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.pdf): \
592 $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf : \
593 $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex \
594 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/%/ucs.sty) \
595 $(foreach f,$(VBOX_MANUAL_LANGUAGES),\
596 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_PNG_FILES_$(f)))) | $$(dir $$@)
597# PDF generation via Latex: generate the .tex file
598 $(call MSG_L1,pdflatex $< (four passes) -> $@)
599 $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
600 $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
601 $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
602 $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
603 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
604 $(QUIET)$(SED) -n \
605 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
606 $(basename $@).log
607
608##@todo restore this when above has been converted to INSTALLS target. $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
609
610# generate temporary LaTeX source from processed XML
611$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.tex): \
612 $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex : \
613 $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.xml \
614 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
615 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
616 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/%/validatemanual.run,) \
617 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT)
618 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
619 $(QUIET)$(RM) -f $(addprefix $(@D)/,$(VBOX_MANUAL_LATEX_FILES_TARGET))
620# generate TeX source from processed docbook and store it in UserManual.tex.tmp;
621# pass current language to xsltproc in TARGETLANG variable (extract it from the
622# current directory, should become "de_DE" or the like)
623 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG $(notdir $(@D)) \
624 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
625# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
626# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
627 $(QUIET)$(SED) \
628 -e 's|^\\QUOTE{}|\\OQ{}|g' \
629 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
630 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
631 --output $@ [email protected]
632 $(QUIET)$(RM) -f [email protected]
633
634# Useful aliases
635usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
636
637debug-usermanual:
638 $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
639
640#
641# Generate rules for validating the UserManual.xml. These are invoked
642# automatically at build time, but can also be manually invoked via the
643# 'validatemanual' and 'validatemanual_<lang>' aliases.
644#
645define def_vbox_validate_xml
646validatemanual_$(lang):: $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run
647$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run: \
648 $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/UserManual.xml \
649 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
650 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
651 $$(call MSG_L1,Validating $$<)
652 $$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$<
653 $$(QUIET)$$(APPEND) -t "$$@" "done"
654endef
655$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_validate_xml))
656validatemanual:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),validatemanual_$(lang))
657
658
659
660#
661# SDKRef.pdf
662#
663
664# Replace <tt> tags in VirtualBox.xidl.
665$(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
666 $(call MSG_L1,Generating $@)
667 $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
668 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
669 --output $@ $<
670
671# Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
672$(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
673 $(call MSG_L1,Generating $@)
674 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
675
676$(evalcall2 def_vbox_replace_stuff_in_xml,/en_US/SDKRef.xml,/en_US)
677$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.xml: $(VBOX_MANUAL_APIREF_TMP)
678
679# Turn SDKRef.xml into latex.
680$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
681 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
682 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
683 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT) | $$(dir $$@)
684 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
685 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
686# check it for validity first.
687 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
688# generate TeX source from processed docbook and store it in SDKRef.tex.tmp
689 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
690 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
691# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
692# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
693 $(QUIET)$(SED) \
694 -e 's|^\\QUOTE{}|\\OQ{}|g' \
695 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
696 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
697 --output $@ [email protected]
698 $(QUIET)$(RM) -f [email protected]
699
700# Turn SDKRef.tex into a PDF.
701$(VBOX_PATH_SDK)/docs/SDKRef.pdf: \
702 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
703 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
704 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
705 $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/docs
706 $(call MSG_L1,pdflatex $< (three passes))
707 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
708 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
709 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
710 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
711 $(QUIET)$(SED) -n \
712 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
713 $(basename $<).log
714 $(QUIET)$(CP) $(<D)/SDKRef.pdf $@
715 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
716
717
718# Handy aliases.
719validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.xml
720sdkref:: $(VBOX_PATH_SDK)/docs/SDKRef.pdf
721
722
723ifdef VBOX_WITH_DOCS_CHM
724 #
725 # VirtualBox.chm
726 #
727 # We first generate a .hhp help source file from the preprocessed
728 # DocBook XML files, as defined above, then feed that into the
729 # Microsoft Help Compiler.
730 #
731 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-htmlhelp-formatcfg.xsl,/$(lang)))
732
733 # Manual formatcfg dependencies for the above.
734 $(foreach lang,$(VBOX_MANUAL_LANGUAGES), $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/docbook-htmlhelp-formatcfg.xsl): \
735 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
736 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
737
738 $(PATH_STAGE_BIN)/VirtualBox.chm: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.chm
739 $(QUIET)$(CP) $< $@
740 $(call MSG_L1,Fresh CHM is now at $@)
741
742 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm): \
743 $(PATH_STAGE_BIN)/VirtualBox_%.chm : $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm
744 $(QUIET)$(CP) $< $@
745 $(call MSG_L1,Fresh CHM is now at $@)
746
747 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/VirtualBox.chm): \
748 $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm: \
749 $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp \
750 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(f))))
751 $(call MSG_L1,hhc $<,=> $@)
752 $(QUIET)$(RM) -f $@
753 $(QUIET)$(VBOX_HHC) $(subst /,\\,$<)
754
755 # Prepare the XSL file for our title page, htmlhelp variant.
756 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/titlepage-htmlhelp.xsl): \
757 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
758 $(call MSG_L1,xsltproc $<)
759 $(QUIET)$(RM) -f [email protected] $@
760 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
761 $(QUIET)$(MV) -f [email protected] $@
762
763 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/htmlhelp.hhp): \
764 $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp: \
765 $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.xml \
766 $(VBOX_PATH_MANUAL_OUTBASE)/%/docbook-htmlhelp-formatcfg.xsl \
767 $(VBOX_PATH_MANUAL_OUTBASE)/%/titlepage-htmlhelp.xsl \
768 $(VBOX_PATH_MANUAL_OUTBASE)/%/validatemanual.run \
769 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
770 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK)
771 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
772 $(QUIET)$(RM) -f $@
773 $(QUIET)$(MKDIR) -p $(@D)
774 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --output $(@D)/ \
775 --stringparam htmlhelp.chm \
776 $(subst /,\\,$(@D)/../VirtualBox.chm) \
777 $(HTMLHELPOPTS) $(@D)/../docbook-htmlhelp-formatcfg.xsl \
778 $<
779
780 # copy the PNG files.
781 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
782 define def_vbox_cp_images_html
783 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
784 $$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
785 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
786 $$(call MSG_L1,Copying temporary $$< => $$@)
787 $$(QUIET)$$(CP) -f $$< $$@
788 endef
789
790 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_html)))
791
792 # Packing the docs into a zip file
793 $(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
794 $(call MSG_L1,Packing documentation $@)
795 $(QUIET)$(RM) -f $@
796 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- zip$(HOSTSUFF_EXE) -9 $@ $(notdir $^)
797
798endif # VBOX_WITH_DOCS_CHM
799
800
801##########################################################################################
802#
803# UserManual.html
804#
805##########################################################################################
806$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-html-one-page-formatcfg.xsl,/en_US)
807$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-html-chunks-formatcfg.xsl,/en_US)
808
809# Manual formatcfg dependencies.
810$(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
811$(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl: \
812 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
813 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
814
815$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
816 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
817 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
818 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
819 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
820 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
821 | $$(dir $$@)
822 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
823 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) \
824 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
825 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
826 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
827
828$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
829 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
830 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
831 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
832 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
833 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
834 | $$(dir $$@)
835 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
836 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) \
837 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
838 --stringparam chunk.section.depth 0 \
839 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
840 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
841
842$(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
843 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
844 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
845 $(call MSG_L1,Packing documentation $@)
846 $(QUIET)$(RM) -f $@
847 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- zip$(HOSTSUFF_EXE) \
848 -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
849
850html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
851html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
852html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
853
854
855#
856# ChangeLog.html
857#
858# This XSLT rule depends on $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml, which is build by the complex rule
859# $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_ChangeLog.xml): ...
860# much further above. That rule takes en_US/user_ChangeLog.xml and replaces $VIRTUALBOX_CHANGELOG_IMPL
861# with the actual change log contained in user_ChangeLogImpl.xml
862#
863$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-changelog-formatcfg.xsl,/en_US)
864$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
865 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-changelog-formatcfg.xsl \
866 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
867 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) | $$(dir $$@)
868 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
869 $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
870 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
871
872cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
873
874
875
876endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
877
878
879#
880# VBoxManage man pages (parts also required by VBoxManage build-in help).
881#
882$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-manpage.xsl,)
883
884##
885# Emits rules for preprocessing refentry sources (applying remarks element),
886# and for producing the actual man pages.
887# $(evalcall2 def_vbox_refentry_to_manpage)
888# @param 1 The language
889# @param 2 The file name (no path).
890define def_vbox_refentry_to_manpage
891$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
892 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
893 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
894 $$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
895 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
896 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
897 $$(QUIET)$$(RM) -f "$$@"
898 $$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ \
899 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
900 ifdef VBOX_WITH_XMLLINT
901 $$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
902 endif
903
904$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
905 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
906 $$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-manpage.xsl \
907 $$(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
908 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
909 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
910 $$(QUIET)$$(RM) -f "$$@"
911 $$(QUIET)$$(VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-manpage.xsl $$<
912endef
913$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
914, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
915
916
917# Handy aliases.
918validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
919man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
920 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
921
922
923#
924# VBoxManage built-in help.
925#
926# Note! Generating the stuff here is a bit annoying, but currently the most
927# practical way I can come up with.
928#
929OTHERS += \
930 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
931 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
932OTHER_CLEAN += \
933 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
934 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
935help-experiment:: \
936 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
937 $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
938
939$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
940$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
941
942$(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp: \
943 $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl \
944 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
945 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
946 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$@)
947 $(QUIET)$(APPEND) -tn "$@" \
948 '/* Autogenerated by $<, do not edit! */' \
949 '' \
950 '#include <iprt/types.h>' \
951 '#include "VBoxManageBuiltInHelp.h"' \
952 ''
953 $(foreach refentry,$(filter %.xml,$^) \
954 ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) $< $(refentry))
955 $(QUIET)$(APPEND) -n "$@" \
956 '' \
957 'PCREFENTRY g_apHelpEntries[] = ' \
958 '{' \
959 $(foreach refentry,$(filter %.xml,$^) \
960 , ' &g_$(subst -,_,$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry)))))), ') \
961 '};' \
962 'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
963 ''
964
965$(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h: \
966 $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-H-help.xsl \
967 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(filter man_VBoxManage-%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
968 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$(dir $$@)
969 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(filter %.xml,$^),$@)
970 $(QUIET)$(APPEND) -tn "$@" \
971 '/* Autogenerated by $<, do not edit! */' \
972 '' \
973 '#ifndef ___VBoxManageBuiltInHelp_h___' \
974 '#define ___VBoxManageBuiltInHelp_h___' \
975 '' \
976 '#include <VBox/refentry.h>' \
977 '' \
978 'RT_C_DECLS_BEGIN' \
979 '' \
980 'typedef enum HELP_CMD_VBOXMANAGE' \
981 '{' \
982 ' HELP_CMD_VBOXMANAGE_INVALID = 0,'
983 $(foreach refentry,$(filter %.xml,$^) \
984 ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) \
985 --stringparam 'g_sMode' 'cmd' $< $(refentry))
986 $(QUIET)$(APPEND) -n "$@" \
987 ' HELP_CMD_VBOXMANAGE_END' \
988 '} HELP_CMD_VBOXMANAGE;'
989 $(foreach refentry,$(filter %.xml,$^) \
990 ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) \
991 --stringparam 'g_sMode' 'subcmd' $< $(refentry))
992 $(QUIET)$(APPEND) -n "$@" \
993 '' \
994 'extern PCREFENTRY g_apHelpEntries[];' \
995 'extern const uint32_t g_cHelpEntries;' \
996 '' \
997 'RT_C_DECLS_END' \
998 '' \
999 '#endif' \
1000 ''
1001
1002
1003include $(FILE_KBUILD_SUB_FOOTER)
1004
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette