VirtualBox

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

Last change on this file since 99047 was 99047, checked in by vboxsync, 21 months ago

manual/Makefile.kmk: Move a few things around a bit, no actual changes. bugref:10302

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.6 KB
Line 
1# $Id: Makefile.kmk 99047 2023-03-19 12:45:46Z vboxsync $
2## @file
3# Sub-Makefile for the VirtualBox User Manual, SDK reference and other manuals.
4#
5
6#
7# Copyright (C) 2006-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28#
29# This slightly messy makefile transforms the DocBook XML source for the
30# user manual into presentation output. We support two targets:
31#
32# -- UserManual.pdf, generated by LaTex
33#
34#
35# Both files end up in PATH_STAGE_BIN.
36#
37# Both targets indirectly depend on the XML files in this directory;
38# "indirectly" because we first copy them to PATH_TARGET and hack them
39# up a bit for variable substitution and such (see below).
40# The toolchains are roughly like this:
41#
42# -- PDF file via Apache FOP: pre-process the XML files in PATH_TARGET,
43# then create a .FO file (another XML format for "formatted objects")
44# via xsltproc, then feed the .FO file to Apache FOP to create the PDF.
45#
46# -- PDF file via LaTeX: pre-process the XML files in PATH_TARGET, then
47# run our custom "dblatex" perl script on UserManual.xml, which parses
48# the XML (using the Perl SAX parsers) and dumps a matching LaTeX file
49# to UserManual.tex. This is then regularly processed by pdflatex to
50# generate PDF.
51#
52#
53
54SUB_DEPTH = ../..
55include $(KBUILD_PATH)/subheader.kmk
56
57ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
58 include $(PATH_SUB_CURRENT)/Config.kmk
59endif
60
61
62
63#
64# Globals
65#
66
67# Error out if someone tries to override old globals.
68ifdef DOCBOOKPATH
69 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
70endif
71ifdef DOCBOOKPATH
72 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
73endif
74ifdef XML_CATALOG
75 $(error XML_CATALOG was renamed to VBOX_XML_CATALOG!)
76endif
77ifdef XML_CATALOG_DOCBOOK
78 $(error XML_CATALOG_DOCBOOK was renamed to VBOX_XML_CATALOG_DOCBOOK!)
79endif
80ifdef PDFLATEX_INTERACTION
81 $(error PDFLATEX_INTERACTION was renamed to VBOX_PDFLATEX_INTERACTION!)
82endif
83ifdef PDFLATEX
84 $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
85endif
86
87VBOX_QHELP_OUTPUT_FILES = \
88 UserManual.qch \
89 UserManual.qhc
90
91# VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
92# without catting the log a million times.
93VBOX_PDFLATEX_INTERACTION ?= batchmode
94ifeq ($(KBUILD_HOST),win)
95 ifndef VBOX_PDFLATEX
96 VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
97 ifneq ($(VBOX_PDFLATEX),)
98 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
99 endif
100 endif
101 ifndef VBOX_PDFLATEX
102 # Tell MiKTeX to automatically download packages if system wide install.
103 VBOX_PDFLATEX := pdflatex
104 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
105 endif
106else
107 VBOX_PDFLATEX ?= pdflatex
108 VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
109 VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
110endif
111
112# SDK related globals.
113VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
114VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
115VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
116
117
118##
119# Copies DITA-OT to $1, runs the dost.jar with /ditadir given and nukes $1 when done.
120#
121# Additional options for dost.jar can be specified following the call to VBOX_DITA_RUN_DOST
122#
123# @param 1 Temporary+unique DITA-OT path.
124# @param 2 Additional kmk_redirect options.
125#
126VBOX_DITA_RUN_DOST ?= $(REDIRECT) \
127 -E 'ANT_OPTS=-Xmx512m -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl' \
128 -E 'ANT_HOME=$1/tools/ant' \
129 -E 'DITA_DIR=$1' \
130 -E 'JAVA_HOME=$(VBOX_JAVA_HOME)' \
131 -A 'PATH=$(HOST_PATH_SEP)$1/tools/ant/bin' \
132 -E 'CLASSPATH=$1/lib/dost.jar' \
133 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib' \
134 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/commons-codec-1.4.jar' \
135 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/resolver.jar' \
136 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/icu4j.jar' \
137 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/xercesImpl.jar' \
138 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/xml-apis.jar' \
139 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/saxon/saxon9.jar' \
140 -A 'CLASSPATH=$(HOST_PATH_SEP)$1/lib/saxon/saxon9-dom.jar' \
141 $2 \
142 -- $(ASH) $(VBOX_PATH_MANUAL_SRC)/dita-ot-copy-exec.sh "$(VBOX_DITA_ORIGINAL_PATH)" "$1" \
143 -- $(VBOX_JAVA) -jar "$1/lib/dost.jar" "/ditadir:$1" # "/outercontrol:fail" ?
144
145
146#
147# Targets
148#
149
150BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
151
152if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
153 if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
154 INSTALLS += VBox-docs-sdkref
155 endif
156
157 ifdef VBOX_WITH_DOCS_HTML
158 INSTALLS += VBox-docs-usermanual-html
159 VBOX_PATH_BIN_HTML = $(PATH_STAGE_BIN)/UserManual-html.zip
160 else # Do not build html.
161 VBOX_PATH_BIN_HTML =
162 endif
163
164 ifdef VBOX_WITH_DOCS_QHELP
165 INSTALLS += VBox-docs-usermanual-qhelp
166 ifdef VBOX_WITH_QT6
167 USES += qt6
168 QHELPGENERATOR = $(PATH_TOOL_QT6_LIBEXEC)/qhelpgenerator
169 else # Qt5
170 USES += qt5
171 QHELPGENERATOR_VERSION_MINOR = $(shell $(REDIRECT) -E QT_QPA_PLATFORM_PLUGIN_PATH=$(PATH_SDK_QT5)/plugins -- $(PATH_TOOL_QT5_BIN)/qhelpgenerator -v 2>/dev/null | $(SED) -ne 's/.*(Qt [1-9][0-9]*\.\([1-9][0-9]*\)\.[1-9][0-9]*).*$$/\1/p')
172 QHELPGENERATOR = $(PATH_TOOL_QT5_BIN)/$(if-expr $(QHELPGENERATOR_VERSION_MINOR) >= 12,qhelpgenerator,qcollectiongenerator)
173 endif
174 endif
175 ifdef VBOX_WITH_DOCS_QHELP_PACKING
176 VBOX_PATH_BIN_QHELP = \
177 $(PATH_STAGE_BIN)/UserManual.qch \
178 $(PATH_STAGE_BIN)/UserManual.qhc
179 else # Do not install/pack qhelp.
180 VBOX_PATH_BIN_QHELP :=
181 endif
182
183 ifndef VBOX_ONLY_SDK
184 VBOX_MANUAL_PACK += \
185 $(PATH_STAGE_BIN)/UserManual.pdf \
186 $(VBOX_PATH_BIN_HTML) \
187 $(VBOX_PATH_BIN_QHELP)
188 INSTALLS += VBox-docs-usermanual
189
190 ifdef VBOX_WITH_DOCS_TRANSLATIONS
191 INSTALLS += VBox-docs-usermanual-l10n
192 VBOX_MANUAL_PACK += \
193 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
194 endif
195 endif # !VBOX_ONLY_SDK
196
197 ifdef VBOX_WITH_DOCS_ACCESSIBILITY
198 INSTALLS += \
199 VBox-docs-accessibility \
200 VBox-docs-accessibility-html
201 endif
202
203 ifdef VBOX_ONLY_DOCS
204 PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
205 endif
206
207 ifdef VBOX_WITH_DOCS_TRANSLATIONS
208 VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
209 endif
210
211 $(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
212 $(eval VBOX_MANUAL_XML_FILES_GENERATED_$$(lang) := \
213 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
214 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
215 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_man_VBoxHeadless.xml \
216 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_man_vboximg-mount.xml \
217 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_isomakercmd-man.xml))
218
219 VBOX_SDKREF_XML_FILES = \
220 SDKRef.xml
221
222 VBOX_ACCESSIBILITY_XML_FILES = \
223 Accessibility.xml
224
225
226 # Wildcard the images path for every supported language
227 $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
228 $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
229
230 VBOX_MANUAL_TEX_UNICODE_FILES = \
231 $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
232
233 VBOX_MANUAL_LATEX_FILES_TARGET = \
234 $(addprefix UserManual.,aux log out toc tex)
235
236 VBOX_SDKREF_LATEX_FILES_TARGET = \
237 $(addprefix SDKRef.,aux log out toc tex)
238
239 VBOX_ACCESSIBILITY_LATEX_FILES_TARGET = \
240 $(addprefix Accessibility.,aux log out toc tex)
241
242 BLDDIRS += \
243 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, \
244 $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
245 $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
246 $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
247 $(addsuffix /qhelp, $(VBOX_MANUAL_LANGUAGES)) \
248 $(addsuffix /qhelp/images, $(VBOX_MANUAL_LANGUAGES)) \
249 $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
250 $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
251 )
252
253 # Explicit cleaning has some overlap with default cleaning rules, since this
254 # Makefile is using very complex conditionals for selectively creating
255 # specific files, and not everyone remembers to use the same with "kmk clean".
256 OTHER_CLEAN += \
257 $(VBOX_XML_CATALOG) \
258 $(VBOX_XML_CATALOG_DOCBOOK) \
259 $(VBOX_XML_CATALOG_MANUAL) \
260 $(VBOX_XML_ENTITIES) \
261 $(foreach lang, $(VBOX_MANUAL_LANGUAGES) \
262 ,$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
263 $(VBOX_XML_XREF_TO_TEXT) \
264 $(VBOX_XML_XREF_TO_TEXT).cat \
265 $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
266 $(VBOX_MANUAL_XML_REFENTRY_FILES) \
267 $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
268 man_VBoxHeadless.xml \
269 user_man_VBoxHeadless.xml \
270 man_vboximg-mount.xml \
271 user_man_vboximg-mount.xml \
272 isomakercmd-man.xml \
273 user_isomakercmd-man.xml \
274 $(VBOX_MANUAL_LATEX_FILES_TARGET) \
275 $(VBOX_MANUAL_PNG_FILES_$(lang)) \
276 $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
277 $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
278 $(addprefix qhelp/, $(VBOX_MANUAL_PNG_FILES_$(lang))) \
279 html-single/UserManual.html \
280 $(addprefix qhelp/, UserManual.qhp UserManual.qhcp $(VBOX_QHELP_OUTPUT_FILES)) \
281 $(addprefix HTMLHelp/, index.html go01.html) \
282 $(addprefix qhelp/, index.html go01.html) \
283 $(addprefix html-chunks/, index.html go01.html) \
284 $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
285 ,html-chunks/ch$(n).html \
286 html-chunks/re$(n).html \
287 HTMLHelp/ch$(n).html \
288 HTMLHelp/re$(n).html \
289 $(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)) \
290 qhelp/ch$(n).html \
291 qhelp/re$(n).html \
292 $(foreach d2,0 1 2 3 4 5 6 7 8 9,$(foreach d1,0 1 2 3 4 5 6 7 8 9,qhelp/ch$(n)s$(d2)$(d1).html)) ) \
293 $(foreach n,a b c \
294 ,html-chunks/ap$(n).html \
295 HTMLHelp/ap$(n).html \
296 $(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) \
297 qhelp/ap$(n).html \
298 $(foreach s,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20,qhelp/ap$(n)s$(s).html) ) \
299 $(foreach n,01 02 03 04 05 \
300 ,html-chunks/pr$(n).html \
301 HTMLHelp/pr$(n).html \
302 $(foreach s,01 02 03 04 05 06 07 08,HTMLHelp/pr$(n)s$(s).html) \
303 qhelp/pr$(n).html \
304 $(foreach s,01 02 03 04 05 06 07 08,qhelp/pr$(n)s$(s).html) ) \
305 HTMLHelp/toc.hhc \
306 HTMLHelp/htmlhelp.hhp \
307 qhelp/toc.hhc \
308 qhelp/htmlhelp.hhp \
309 UserManual.pdf \
310 VirtualBox.chm \
311 $(VBOX_QHELP_OUTPUT_FILES) \
312 ChangeLog.html \
313 validatemanual.run \
314 validateaccessibility.run \
315 validatesdkref.run \
316 ) \
317 ) \
318 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
319 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
320 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
321 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
322 $(PATH_STAGE_BIN)/UserManual.pdf \
323 $(PATH_STAGE_BIN)/VirtualBox.chm \
324 \
325 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
326 $(VBOX_SDKREF_LATEX_FILES_TARGET) \
327 SDKRef.pdf \
328 ) \
329 $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf \
330 \
331 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
332 $(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET) \
333 html-single/Accessibility.html \
334 Accessibility.pdf \
335 ) \
336 $(PATH_STAGE_BIN)/Accessibility.html \
337 $(PATH_STAGE_BIN)/Accessibility.pdf \
338 \
339 $(VBOX_DOC_XIDL_SRC_TMP) \
340 $(VBOX_MANUAL_APIREF_TMP)
341
342endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
343
344#
345# target for installing UserManual.pdf
346#
347VBox-docs-usermanual_INST = $(INST_BIN)
348VBox-docs-usermanual_MODE = a+r,u+w
349VBox-docs-usermanual_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf
350
351VBox-docs-usermanual-qhelp_INST = $(INST_BIN)
352VBox-docs-usermanual-qhelp_MODE = a+r,u+w
353VBox-docs-usermanual-qhelp_SOURCES = \
354 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qhc \
355 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qch
356
357#
358# target for installing translated UserManual_*.pdf
359#
360VBox-docs-usermanual-l10n_INST = $(INST_BIN)
361VBox-docs-usermanual-l10n_MODE = a+r,u+w
362VBox-docs-usermanual-l10n_SOURCES = \
363 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/UserManual.pdf=>UserManual_$(f).pdf)
364
365#
366# target for installing the chunked HTML docs
367#
368VBox-docs-usermanual-html_INST = $(INST_BIN)
369VBox-docs-usermanual-html_MODE = a+r,u+w
370VBox-docs-usermanual-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip=>UserManual-html.zip
371
372#
373# target for installing SDKRef.pdf
374#
375VBox-docs-sdkref_INST = $(INST_SDK)docs/
376VBox-docs-sdkref_MODE = a+r,u+w
377VBox-docs-sdkref_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf
378
379#
380# target for installing Accessibility.pdf
381#
382VBox-docs-accessibility_INST = $(INST_BIN)
383VBox-docs-accessibility_MODE = a+r,u+w
384VBox-docs-accessibility_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf
385
386#
387# target for installing Accessibility.html
388#
389VBox-docs-accessibility-html_INST = $(INST_BIN)
390VBox-docs-accessibility-html_MODE = a+r,u+w
391VBox-docs-accessibility-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
392
393if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
394
395 ##
396 # Morph man pages into manual sections.
397 # $(evalcall2 def_vbox_refentry_to_user_sect1)
398 # @param 1 Language.
399 # @param 2 the refentry xml base file name.
400 # @param 3 the full refentry xml file path.
401 define def_vbox_refentry_to_user_sect1
402 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): $(3) \
403 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
404 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
405 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
406 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(filter %.xml,$$^),$$@)
407 $$(QUIET)$$(RM) -f "$$@"
408 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
409 endef
410 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
411man_VBoxHeadless.xml \
412man_vboximg-mount.xml \
413, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file),$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file))))
414 $(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
415,$(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),isomakercmd-man.xml,$(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
416
417
418 # Generates the VBoxManage command overview include file (shared between
419 # languages) from the refsynopsisdiv section of the man pages.
420 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
421 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
422 $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
423 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
424 $(VBOX_XML_ENTITIES) | $$(dir $$@)
425 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
426 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
427
428
429
430
431
432 ##########################################################################################
433 #
434 # Shared rules for PDF generation
435 #
436 ##########################################################################################
437
438 ifndef VBOX_OSE
439 # copy ucs.sty and related files
440 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
441 $(call MSG_L1,Copying unicode support for LaTeX)
442 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
443 endif
444
445 # copy the PNG files.
446 # Note: out_dir referenced with double $$ to delay expansion to the eval step when out_dir has been defined.
447 define def_vbox_cp_images_pdf
448 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
449 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
450 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
451 $$(call MSG_L1,Copying temporary $$< => $$@)
452 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
453 endef
454 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
455
456
457 #
458 # SDKRef.pdf
459 #
460
461 # Replace <tt> tags in VirtualBox.xidl.
462 $(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
463 $(call MSG_L1,Generating $@)
464 $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
465 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
466 --output $@ $<
467
468 # Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
469 $(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
470 $(call MSG_L1,Generating $@)
471 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
472
473 # Turn SDKRef.xml into LaTeX.
474 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
475 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
476 $(VBOX_MANUAL_APIREF_TMP) \
477 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
478 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run,) \
479 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
480 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
481 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
482 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
483 # generate TeX source from processed docbook and store it in SDKRef.tex.tmp
484 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
485 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
486 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
487 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
488 $(QUIET)$(SED) \
489 -e 's|^\\QUOTE{}|\\OQ{}|g' \
490 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
491 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
492 --output $@ [email protected]
493 $(QUIET)$(RM) -f [email protected]
494
495 # Turn SDKRef.tex into a PDF.
496 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf: \
497 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
498 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
499 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
500 $(call MSG_L1,pdflatex $< (three passes))
501 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
502 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
503 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
504 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
505 $(QUIET)$(SED) -n \
506 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
507 $(basename $<).log
508 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
509
510 # Validating SDKRef.xml. It is invoked automatically at build time,
511 # but can also be manually invoked via the 'validate-sdkref' alias.
512 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run: \
513 $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml \
514 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
515 $(VBOX_MANUAL_APIREF_TMP) \
516 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
517 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
518 $(call MSG_L1,Validating $<)
519 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
520 $(QUIET)$(APPEND) -t "$@" "done"
521
522
523 # Handy aliases.
524 validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run
525 sdkref:: $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
526
527
528
529 #
530 # Accessibility.pdf
531 #
532
533 # Turn Accessibility.xml into LaTeX.
534 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex: \
535 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
536 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
537 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run,) \
538 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
539 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
540 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
541 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET))
542 # generate TeX source from processed docbook and store it in Accessibility.tex.tmp
543 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
544 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
545 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
546 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
547 $(QUIET)$(SED) \
548 -e 's|^\\QUOTE{}|\\OQ{}|g' \
549 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
550 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
551 --output $@ [email protected]
552 $(QUIET)$(RM) -f [email protected]
553
554 # Turn Accessibility.tex into a PDF.
555 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf: \
556 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex \
557 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
558 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
559 $(call MSG_L1,pdflatex $< (three passes))
560 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
561 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
562 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
563 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
564 $(QUIET)$(SED) -n \
565 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
566 $(basename $<).log
567 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
568
569 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html: \
570 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
571 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
572 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
573 $(VBOX_XML_ENTITIES) | $$(dir $$@)
574 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
575 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
576 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html \
577 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
578 $<
579
580 # Validating Accessibility.xml. It is invoked automatically at build time,
581 # but can also be manually invoked via the 'validate-accessibility' alias.
582 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run: \
583 $(VBOX_PATH_MANUAL_SRC)/en_US/Accessibility.xml \
584 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
585 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
586 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
587 $(call MSG_L1,Validating $<)
588 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
589 $(QUIET)$(APPEND) -t "$@" "done"
590
591
592 # Handy aliases.
593 validate-accessibility:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run
594 accessibility:: $(PATH_STAGE_BIN)/Accessibility.pdf
595 accessibility-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
596
597
598 # A few things which are shared between htmlhelp and qhelp docs.
599 VBOX_DOCBOOK_HTMLHELP_FORMATCFG = \
600 $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
601 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
602 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
603
604 # Prepare the XSL file for our title page, htmlhelp and qhelp variant.
605 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl: \
606 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
607 $(call MSG_L1,xsltproc $<)
608 $(QUIET)$(RM) -f [email protected] $@
609 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
610 $(QUIET)$(MV) -f [email protected] $@
611
612 # Packing the docs into a zip file
613 $(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
614 $(call MSG_L1,Packing documentation $@)
615 $(QUIET)$(RM) -f $@
616 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
617
618
619 ##########################################################################################
620 #
621 # DITA stuff common to pdf, qhelp, and html outputs.
622 # - copy DITA-OT library (binaries etc) since at each run several run-time config
623 # files are updated.
624 # - create dita/topic folder and copy all user manual dita files under that.
625 # - copy all images under dita/topics/images and UserManual.ditamap under dita folder
626 # - copy all man_V*.xml docbook files under dita/topic folder.
627 # - flatten refsect1/refsect2 hierarchy in man_V*.xml docbook files by
628 # using refsect2_to_refsect1.py.
629 # - convert man_V*.xml files into dita files
630 # - mark external link in the man_V*.dita files
631 # - correct all reference targets by calling correct_references.py.
632 #
633 # Note! INSTALL_STAGING is likely to hardlink the files, thus we must use +| below
634 # when copying files as much won't change timestamp. It would in fact be a _lot_
635 # better to copy the files individually.
636 #
637 ##########################################################################################
638
639 BLDDIRS += \
640 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita \
641 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics \
642 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images
643
644 VBOX_USER_MANUAL_STAGED_DITA_FILES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/, \
645 $(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita)))
646 VBOX_USER_MANUAL_STAGED_IMAGE_FILES := $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images/, \
647 $(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*)))
648
649 $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
650 $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES) \
651 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap: \
652 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/% : \
653 $(VBOX_PATH_MANUAL_SRC)/en_US/dita/% | $$(dir $$@)
654 $(QUIET)$(INSTALL_STAGING) -m 0644 -- "$<" "$(@D)/"
655
656 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd: | $$(dir $$@)
657 $(QUIET)$(TOUCH) -- "$@"
658
659 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml: \
660 $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml | $$(dir $$@)
661 $(QUIET)$(INSTALL_STAGING) -m 0644 -- "$<" "$(@D)/"
662
663 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common: \
664 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap \
665 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/reference.dtd \
666 $(VBOX_USER_MANUAL_STAGED_DITA_FILES) \
667 $(VBOX_USER_MANUAL_STAGED_IMAGE_FILES) \
668 $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES)
669 $(call MSG_L1, Ran common dita steps)
670 $(QUIET)$(TOUCH) -- "$@"
671
672
673 ##########################################################################################
674 #
675 # Docbook to Dita conversion of our refentry files
676 #
677 ##########################################################################################
678
679 # Generate a ID to FILE mapping database that def_vbox_refentry_to_dita can apply below.
680 VBOX_USER_MANUAL_ID_MAPPING_FILE := $(VBOX_PATH_MANUAL_OUTBASE)/en_US/id-mapping-file.db
681 OTHER_CLEAN += $(VBOX_USER_MANUAL_ID_MAPPING_FILE)
682 $(VBOX_USER_MANUAL_ID_MAPPING_FILE): \
683 $(VBOX_PATH_MANUAL_SRC)/build_id_to_file_mapping.py \
684 $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/*.xml $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*.dita) \
685 | $(dir $@)
686 $(call MSG_L1, $<)
687 $(QUIET)$(VBOX_BLD_PYTHON) "$<" --output "$@" \
688 "$(VBOX_PATH_MANUAL_SRC)/en_US/*.xml" \
689 "$(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*.dita"
690
691 # Accumulated list of conversion output file names used by dita_common above.
692 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES := $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita
693
694 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/user_isomakercmd-man.dita: \
695 $(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \
696 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml | $$(dir $$@)
697 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
698 --maxdepth 6000 \
699 --output "$@" \
700 "$<" \
701 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_isomakercmd-man.xml
702
703 define def_vbox_refentry_to_dita
704 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES += $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(basename $(2)).dita
705 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(basename $(2)).dita \
706 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2): \
707 $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \
708 $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2)) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2)) \
709 $$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl \
710 $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
711 $$(VBOX_USER_MANUAL_ID_MAPPING_FILE) \
712 $$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/man_VBoxManage-dhcpserver-dhcpoptions.xml \
713 $$(VBOX_XML_CATALOG) \
714 $$(VBOX_XML_CATALOG_DOCBOOK) \
715 $$(VBOX_XML_CATALOG_MANUAL) \
716 $$(VBOX_XML_ENTITIES) \
717 $$(VBOX_VERSION_STAMP) \
718 | $$$$(dir $$$$@)
719 $$(call MSG_TOOL,xsltproc docbook2dita.xsl,,$$(firstword $$(filter %.xml,$$^)),$$@)
720 $$(QUIET)$$(RM) -f "$$@"
721 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/refsect2_to_refsect1.py \
722 -i $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2)) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2)) \
723 -o "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)"
724 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \
725 "$$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl" \
726 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)"
727 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output "$$@" \
728 "$$(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl" "$$@"
729 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
730 --mapping-file "$$(VBOX_USER_MANUAL_ID_MAPPING_FILE)" "$$@"
731 endef
732 $(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
733 ,$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount.xml man_VBoxHeadless.xml \
734 ,$(evalcall2 def_vbox_refentry_to_dita,$(lang),$(file))))
735
736
737 ##########################################################################################
738 #
739 # UserManual.html
740 #
741 ##########################################################################################
742
743 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
744 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
745 $(call MSG_L1,Packing documentation $@)
746 $(QUIET)$(RM) -f $@
747 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- $(VBOX_ZIP) \
748 -9 -r $@ html-chunks
749
750 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
751 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common
752 $(call MSG_L1,Building html chunks $@)
753 $(QUIET)$(RM) -Rf -- "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks/"
754 $(QUIET)$(call VBOX_DITA_RUN_DOST,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks) \
755 "/i:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap" \
756 "/transtype:xhtml" \
757 "/outdir:$(@D)" \
758 "/tempdir:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/temp_xhtml"
759
760 # disable for now
761 ## bird: Remove @chunk attrib from Glossary.dita topicref and add chunk="to-content" to bootmap for single html experiments.
762 ## See https://docs.oasis-open.org/dita/v1.2/os/spec/archSpec/chunking.html
763 ## and https://www.oxygenxml.com/forum/post25114.html?hilit=dita%20xhtml%20chunk#p25114
764 ## for further clues.
765 #html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
766
767 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
768 qhelp:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/, $(VBOX_QHELP_OUTPUT_FILES))
769 html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
770
771
772 ##########################################################################################
773 #
774 # Use DITA-OT to create pdf/hhp out of UserManual.ditamap. See usermanual.pdf under
775 # DITA-OT-xxxxx/doc folder for details.
776 #
777 ##########################################################################################
778
779
780 # Note! The /tempdir is deleted, recreated, used and deleted again for each run. So, be careful where you point it.
781 # Note! This crappy utility may fail to find files (or fail to parse the
782 # command line) and still return a successfully (0) exit code.
783 define def_ditamap_to_pdf
784 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf \
785 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log \
786 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.list \
787 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.xml.properties: \
788 $$(VBOX_MANUAL_XML_FILES_COMMON) \
789 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
790 $$(VBOX_PATH_MANUAL_OUTBASE)/dita_common
791 $$(QUIET)$(RM) -f -- "$$@"
792 $$(QUIET)$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf/"
793 $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf) \
794 "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
795 "/transtype:pdf" \
796 "/outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)" \
797 "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf"
798
799 ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf
800 endef
801 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_pdf,$(lang)))
802
803 # Useful aliases
804 usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
805
806 #
807 # ChangeLog.html
808 #
809 # This XSLT rule formats en_US/user_ChangeLog.xml (which includes the actual change log
810 # contained in user_ChangeLogImpl.xml) as a standalone HTML file.
811 #
812 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
813 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
814 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
815 $(VBOX_XML_CATALOG) \
816 $(VBOX_XML_CATALOG_DOCBOOK) \
817 $(VBOX_XML_CATALOG_MANUAL) \
818 $(VBOX_XML_ENTITIES) | $$(dir $$@)
819 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
820 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
821 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
822
823 cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
824
825
826
827endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
828
829
830#
831# VBoxManage man pages (parts also required by VBoxManage built-in help).
832#
833
834##
835# Emits rules for preprocessing refentry sources (applying remarks element),
836# and for producing the actual man pages.
837# $(evalcall2 def_vbox_refentry_to_manpage)
838# @param 1 The language
839# @param 2 The file name (no path).
840define def_vbox_refentry_to_manpage
841 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
842 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
843 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
844 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) \
845 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
846 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
847 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
848 $$(QUIET)$$(RM) -f "$$@"
849 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
850 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
851 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output [email protected] $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) $$@
852 $$(QUIET)$$(MV) -f -- "[email protected]" "$$@"
853 if defined(VBOX_HAVE_XMLLINT)
854 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
855 endif
856
857 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
858 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
859 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl \
860 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
861 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
862 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
863 $$(QUIET)$$(RM) -f "$$@"
864 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl $$<
865endef
866$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
867, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
868
869ifdef VBOX_WITH_DOCS_QHELP
870 #
871 # VirtualBox.qch/VirtualBox.qhc
872 #
873 # We first generate a .hhp help source file from the preprocessed
874 # DocBook XML files, as defined above, then feed that into a converter
875 # creating the suitable input for creating a QHelp collection file.
876
877 # Generate QCH from QHelp source
878 # Note: out_dir referenced with double $$ to delay expansion to the eval step when out_dir has been defined.
879 define def_vbox_usermanual_qhp_to_qch
880 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
881 $$(out_dir)/qhelp/UserManual.qch \
882 + $$(out_dir)/qhelp/UserManual.qhc: \
883 $$(out_dir)/qhelp/UserManual.qhcp \
884 $$(out_dir)/qhelp/UserManual.qhp \
885 $$(addprefix $$(out_dir)/qhelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
886 | $$$$(dir $$$$@)
887 $$(call MSG_L1,$$(notdir $$(QHELPGENERATOR)) $$<,=> $$@)
888 $$(QUIET)$$(RM) -f $$@
889 $$(QUIET)$$(REDIRECT) -E QT_QPA_PLATFORM_PLUGIN_PATH=$$(PATH_SDK_QT5)/plugins -- $$(QHELPGENERATOR) $$<
890 $$(call MSG_L1,Fresh QCH is now at $$@)
891 endef
892 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_qhp_to_qch))
893
894 # Generate QHP from HHP for QHelp
895 # Note: out_dir referenced with double $$ to delay expansion to the eval step when out_dir has been defined.
896 define def_vbox_usermanual_hhp_qhelp_to_qhp
897 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
898 $$(out_dir)/qhelp/UserManual.qhp: \
899 $$(out_dir)/qhelp/UserManual.hhp \
900 $$(addprefix $$(out_dir)/qhelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
901 | $$$$(dir $$$$@)
902 $$(call MSG_L1,htmlhelp-qthelp.py $$<,=> $$@)
903 $$(QUIET)$$(RM) -f $$@
904 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/htmlhelp-qthelp.py -d $$(<D) -o $$@ -f UserManual.hhp -t UserManual.hhc
905 endef
906 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_hhp_qhelp_to_qhp))
907
908
909 # Setting HHCDIR here so that it fails to locate hcc.exe and always skips the
910 # compilation step that produces the .chm-file, since we don't need it and it
911 # mangles the path so it always fails anyway.
912 define def_ditamap_to_htmlhelp
913 ditamap-to-htmlhelp: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp
914 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp: \
915 $(VBOX_PATH_MANUAL_OUTBASE)/dita_common
916 $$(QUIET)$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp/"
917 $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp, -EHHCDIR="$$(@D)") \
918 "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
919 "/transtype:htmlhelp" \
920 "/outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp" \
921 "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_htmlhelp"
922
923 endef
924 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_htmlhelp,$(lang)))
925
926 # copy the qhcp file.
927 define def_vbox_cp_qhcp
928 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/qhelp
929 $$(out_dir)/UserManual.qhcp: \
930 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/% | $$$$(dir $$$$@)
931 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
932 endef
933 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_qhcp)))
934
935 # copy the PNG files.
936 # Note: out_dir referenced with double $$ to delay expansion to the eval step when out_dir has been defined.
937 define def_vbox_cp_images_qhelp
938 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/qhelp
939 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
940 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
941 $$(call MSG_L1,Copying temporary $$< => $$@)
942 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
943 endef
944 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_qhelp)))
945
946endif # VBOX_WITH_DOCS_QHELP
947
948# Handy aliases.
949validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
950man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
951 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
952
953#
954# Manually updating the DHCP option list taken from VirtualBox.xidl
955#
956dhcpoptions: $(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xsl \
957 $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
958 $(call VBOX_XSLTPROC) --output "$(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml" $+
959
960
961include $(FILE_KBUILD_SUB_FOOTER)
962
Note: See TracBrowser for help on using the repository browser.

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