VirtualBox

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

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

more autovalidation fun

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