VirtualBox

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

Last change on this file since 99514 was 99514, checked in by vboxsync, 20 months ago

manual: Added the changelog to the (DITA) manual. bugref:10302

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 48.7 KB
Line 
1# $Id: Makefile.kmk 99514 2023-04-22 01:59:25Z 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 makefile produces our user manual (among a few other things) in
30# 3 formats: qHelp, pdf, and html (chunked and single page). User manual
31# files are kept in dita format. VBoxManage commands are documented using docbook
32# refentry elements and integrated into VBoxManage binary after converting those
33# to .cpp and .h files (not here). Additionally, we add these refentry's into the
34# user manual as a chapter after converting them into dita files. Both the user manual
35# and converted VBoxManage commands files are referenced with a single ditamap.
36# This ditamap is then transformed into html, htmlhelp (for qHelp), and pdf.
37#
38
39
40SUB_DEPTH = ../..
41include $(KBUILD_PATH)/subheader.kmk
42
43ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
44 include $(PATH_SUB_CURRENT)/Config.kmk
45endif
46
47if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK)) # Whole file.
48
49 #
50 # Globals
51 #
52
53 ## Combines the VBOX_MANUAL_LANGUAGES and VBOX_MANUAL_ADD_LANGUAGES lists from
54 # /Config.kmk, as per the VBOX_WITH_DOCS_TRANSLATIONS setting.
55 ifdef VBOX_WITH_DOCS_TRANSLATIONS
56 VBOX_MANUAL_ALL_LANGUAGES := $(VBOX_MANUAL_LANGUAGES) $(VBOX_MANUAL_ADD_LANGUAGES)
57 else
58 VBOX_MANUAL_ALL_LANGUAGES := $(VBOX_MANUAL_LANGUAGES)
59 endif
60
61 ## The files that should go into VBoxDocumentation.zip (must be immediately under PATH_STAGE_BIN).
62 VBOX_MANUAL_PACK =
63
64 # Various file lists (mainly needed for OTHER_CLEAN).
65 VBOX_QHELP_OUTPUT_FILES := UserManual.qch UserManual.qhc
66 VBOX_ACCESSIBILITY_XML_FILES := Accessibility.xml
67 VBOX_MANUAL_LATEX_FILES_TARGET := $(addprefix UserManual.,aux log out toc tex)
68 VBOX_SDKREF_LATEX_FILES_TARGET := $(addprefix SDKRef.,aux log out toc tex)
69 VBOX_ACCESSIBILITY_LATEX_FILES_TARGET := $(addprefix Accessibility.,aux log out toc tex)
70
71 VBOX_MANUAL_TEX_UNICODE_FILES = $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
72
73 # Wildcard the images path for every supported language
74 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES) \
75 ,$(eval VBOX_MANUAL_PNG_FILES_$$(lang) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(lang)/%,%, \
76 $$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(lang)/images/*.png))))
77
78 # SDK related globals.
79 VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
80 VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
81 VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
82
83
84 #
85 # PDF LaTeX related globals.
86 #
87
88 VBOX_PDFLATEX_INTERACTION ?= batchmode
89 # VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
90 # without catting the log a million times.
91 ifeq ($(KBUILD_HOST),win)
92 ifndef VBOX_PDFLATEX
93 VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
94 ifneq ($(VBOX_PDFLATEX),)
95 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
96 endif
97 endif
98 ifndef VBOX_PDFLATEX
99 # Tell MiKTeX to automatically download packages if system wide install.
100 VBOX_PDFLATEX := pdflatex
101 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
102 endif
103 else
104 VBOX_PDFLATEX ?= pdflatex
105 VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
106 VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
107 endif
108
109
110 #
111 # DITA-OT related globals.
112 #
113 VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH = $(VBOX_DITA_ORIGINAL_PATH)/dtd/technicalContent/dtd
114
115 ##
116 # Copies DITA-OT to $1, runs the dost.jar with /ditadir given and nukes $1 when done.
117 #
118 # Additional options for dost.jar can be specified following the call to VBOX_DITA_RUN_DOST
119 #
120 # @param 1 Temporary+unique DITA-OT path.
121 # @param 2 Additional kmk_redirect options.
122 # @param 3 Parameters for the invoker.
123 # @param 4 Parameters only for 1.8.5.
124 # @param 5 Parameters only for 4.0.2.
125 #
126 VBOX_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" $3 $4 # "/outercontrol:fail" ?
144
145 ifdef VBOX_DITA_USING_LATEST # Experiments with dita-ot v4.0.2. Requires java 17.
146 VBOX_DITA_USING_LATEST := 1
147 VBOX_JAVA_HOME := C:/Program Files/Java/jdk-17/
148 VBOX_DITA_ORIGINAL_PATH := D:/Tmp/dita/dita-ot-4.0.2
149 VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH = $(VBOX_DITA_ORIGINAL_PATH)/plugins/org.oasis-open.dita.v1_2/dtd/technicalContent/dtd
150 VBOX_DITA_CLASSPATH = \
151 $(subst $(SP),;,$(strip \
152 $(VBOX_DITA_ORIGINAL_PATH)/lib/ant-launcher.jar \
153 $(VBOX_DITA_ORIGINAL_PATH)/config \
154 $(VBOX_DITA_ORIGINAL_PATH)/lib \
155 $(wildcard \
156 $(VBOX_DITA_ORIGINAL_PATH)/lib/*.jar \
157 $(VBOX_DITA_ORIGINAL_PATH)/plugins/*/lib/*.jar)))
158 VBOX_DITA_RUN_DOST = $(REDIRECT) \
159 -E 'ANT_HOME=$(VBOX_DITA_ORIGINAL_PATH)' \
160 -E 'DITA_DIR=$(VBOX_DITA_ORIGINAL_PATH)' \
161 -E 'JAVA_HOME=$(VBOX_JAVA_HOME)' \
162 -E 'CLASSPATH=$(VBOX_DITA_CLASSPATH)' \
163 $2 \
164 -- \
165 $(VBOX_JAVA) \
166 "-Djava.awt.headless=true" \
167 "-Dsun.io.useCanonCaches=true" \
168 "-Dant.home=$(VBOX_DITA_ORIGINAL_PATH)" \
169 "-Ddita.dir=$(VBOX_DITA_ORIGINAL_PATH)" \
170 org.apache.tools.ant.launch.Launcher \
171 -cp "$(VBOX_DITA_CLASSPATH)" \
172 -buildfile "$(VBOX_DITA_ORIGINAL_PATH)/build.xml" \
173 -main "org.dita.dost.invoker.Main" \
174 $(patsubst "/i:%,"--input=%, \
175 $(patsubst "/transtype:%,"--format=%, \
176 $(patsubst "/outdir:%,"--output=%, \
177 $(patsubst "/tempdir:%,"--temp=%, \
178 $(patsubst "/filter:%,"--filter=%, \
179 $(patsubst "/debug","--debug",$3)))))) \
180 $5 --verbose --debug
181 endif
182
183
184 #
185 # Targets
186 #
187
188 BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_ALL_LANGUAGES))
189
190 ifdef VBOX_ONLY_DOCS
191 PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
192 endif
193
194 BLDDIRS += \
195 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita \
196 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics \
197 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images
198
199 BLDDIRS += \
200 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, \
201 $(addsuffix /images, $(VBOX_MANUAL_ALL_LANGUAGES)) \
202 $(addsuffix /html-single, $(VBOX_MANUAL_ALL_LANGUAGES)) \
203 $(addsuffix /html-chunks, $(VBOX_MANUAL_ALL_LANGUAGES)) \
204 $(addsuffix /qhelp, $(VBOX_MANUAL_ALL_LANGUAGES)) \
205 $(addsuffix /qhelp/images, $(VBOX_MANUAL_ALL_LANGUAGES)) \
206 $(addsuffix /HTMLHelp, $(VBOX_MANUAL_ALL_LANGUAGES)) \
207 $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_ALL_LANGUAGES)) \
208 )
209
210 # Explicit cleaning has some overlap with default cleaning rules, since this
211 # Makefile is using very complex conditionals for selectively creating
212 # specific files, and not everyone remembers to use the same with "kmk clean".
213 OTHER_CLEAN += \
214 $(VBOX_XML_CATALOG) \
215 $(VBOX_XML_CATALOG_DOCBOOK) \
216 $(VBOX_XML_CATALOG_MANUAL) \
217 $(VBOX_XML_ENTITIES) \
218 $(foreach lang, $(VBOX_MANUAL_ALL_LANGUAGES) \
219 ,$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
220 $(VBOX_XML_XREF_TO_TEXT) \
221 $(VBOX_XML_XREF_TO_TEXT).cat \
222 $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
223 $(VBOX_MANUAL_XML_REFENTRY_FILES) \
224 $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
225 man_VBoxHeadless.xml \
226 user_man_VBoxHeadless.xml \
227 man_vboximg-mount.xml \
228 user_man_vboximg-mount.xml \
229 isomakercmd-man.xml \
230 user_isomakercmd-man.xml \
231 $(VBOX_MANUAL_LATEX_FILES_TARGET) \
232 $(VBOX_MANUAL_PNG_FILES_$(lang)) \
233 $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
234 $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
235 $(addprefix qhelp/, $(VBOX_MANUAL_PNG_FILES_$(lang))) \
236 html-single/UserManual.html \
237 $(addprefix qhelp/, UserManual.qhp UserManual.qhcp $(VBOX_QHELP_OUTPUT_FILES)) \
238 $(addprefix HTMLHelp/, index.html go01.html) \
239 $(addprefix qhelp/, index.html go01.html) \
240 $(addprefix html-chunks/, index.html go01.html) \
241 $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
242 ,html-chunks/ch$(n).html \
243 html-chunks/re$(n).html \
244 HTMLHelp/ch$(n).html \
245 HTMLHelp/re$(n).html \
246 $(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)) \
247 qhelp/ch$(n).html \
248 qhelp/re$(n).html \
249 $(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)) ) \
250 $(foreach n,a b c \
251 ,html-chunks/ap$(n).html \
252 HTMLHelp/ap$(n).html \
253 $(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) \
254 qhelp/ap$(n).html \
255 $(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) ) \
256 $(foreach n,01 02 03 04 05 \
257 ,html-chunks/pr$(n).html \
258 HTMLHelp/pr$(n).html \
259 $(foreach s,01 02 03 04 05 06 07 08,HTMLHelp/pr$(n)s$(s).html) \
260 qhelp/pr$(n).html \
261 $(foreach s,01 02 03 04 05 06 07 08,qhelp/pr$(n)s$(s).html) ) \
262 HTMLHelp/toc.hhc \
263 HTMLHelp/htmlhelp.hhp \
264 qhelp/toc.hhc \
265 qhelp/htmlhelp.hhp \
266 UserManual.pdf \
267 $(VBOX_QHELP_OUTPUT_FILES) \
268 ChangeLog.html \
269 validatemanual.run \
270 validateaccessibility.run \
271 validatesdkref.run \
272 ) \
273 ) \
274 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
275 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
276 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
277 $(PATH_STAGE_BIN)/UserManual.pdf \
278 \
279 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
280 $(VBOX_SDKREF_LATEX_FILES_TARGET) \
281 SDKRef.pdf \
282 ) \
283 $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf \
284 \
285 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
286 $(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET) \
287 html-single/Accessibility.html \
288 Accessibility.pdf \
289 ) \
290 $(PATH_STAGE_BIN)/Accessibility.html \
291 $(PATH_STAGE_BIN)/Accessibility.pdf \
292 \
293 $(VBOX_DOC_XIDL_SRC_TMP) \
294 $(VBOX_MANUAL_APIREF_TMP)
295
296
297 ifndef VBOX_ONLY_SDK
298 #
299 # target for installing UserManual.pdf
300 #
301 INSTALLS += VBox-docs-usermanual
302 VBox-docs-usermanual_INST = $(INST_BIN)
303 VBox-docs-usermanual_MODE = a+r,u+w
304 VBox-docs-usermanual_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf
305 VBOX_MANUAL_PACK += $(PATH_STAGE_BIN)/UserManual.pdf
306
307 ifdef VBOX_WITH_DOCS_TRANSLATIONS
308 #
309 # target for installing translated UserManual_*.pdf
310 #
311 INSTALLS += VBox-docs-usermanual-l10n
312 VBox-docs-usermanual-l10n_INST = $(INST_BIN)
313 VBox-docs-usermanual-l10n_MODE = a+r,u+w
314 VBox-docs-usermanual-l10n_SOURCES = \
315 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/UserManual.pdf=>UserManual_$(f).pdf)
316 VBOX_MANUAL_PACK += $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
317 endif
318
319 ifdef VBOX_WITH_DOCS_HTML
320 #
321 # target for installing the chunked HTML docs
322 #
323 INSTALLS += VBox-docs-usermanual-html
324 VBox-docs-usermanual-html_INST = $(INST_BIN)
325 VBox-docs-usermanual-html_MODE = a+r,u+w
326 VBox-docs-usermanual-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip=>UserManual-html.zip
327 VBOX_MANUAL_PACK += $(PATH_STAGE_BIN)/UserManual-html.zip
328 endif
329
330 ifdef VBOX_WITH_DOCS_QHELP
331 #
332 # Installs the qhelp version of the manual.
333 #
334 INSTALLS += VBox-docs-usermanual-qhelp
335 VBox-docs-usermanual-qhelp_INST = $(INST_BIN)
336 VBox-docs-usermanual-qhelp_MODE = a+r,u+w
337 VBox-docs-usermanual-qhelp_SOURCES = \
338 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qhc \
339 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qch
340 ifdef VBOX_WITH_DOCS_QHELP_PACKING
341 VBOX_MANUAL_PACK += \
342 $(PATH_STAGE_BIN)/UserManual.qch \
343 $(PATH_STAGE_BIN)/UserManual.qhc
344 endif
345 endif
346
347 ifdef VBOX_WITH_DOCS_ACCESSIBILITY
348 #
349 # target for installing Accessibility.pdf
350 #
351 INSTALLS += VBox-docs-accessibility
352 VBox-docs-accessibility_INST = $(INST_BIN)
353 VBox-docs-accessibility_MODE = a+r,u+w
354 VBox-docs-accessibility_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf
355
356 #
357 # target for installing Accessibility.html
358 #
359 INSTALLS += VBox-docs-accessibility-html
360 VBox-docs-accessibility-html_INST = $(INST_BIN)
361 VBox-docs-accessibility-html_MODE = a+r,u+w
362 VBox-docs-accessibility-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
363 endif
364
365 endif # !VBOX_ONLY_SDK
366
367 if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
368 #
369 # target for installing SDKRef.pdf
370 #
371 INSTALLS += VBox-docs-sdkref
372 VBox-docs-sdkref_INST = $(INST_SDK)docs/
373 VBox-docs-sdkref_MODE = a+r,u+w
374 VBox-docs-sdkref_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf
375 endif
376
377
378 #
379 # Shared rules for LaTeX based PDF generation - Only used for SDK & Accessibility.
380 #
381
382 ifndef VBOX_OSE
383 # Copy ucs.sty and associated files.
384 ## @todo r=bird: This is ugly since only ucs.sty is listed as output while we're actually copying 177 other files.
385 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/ucs.sty): | $$(dir $$@)
386 $(call MSG_L1,Copying unicode support for LaTeX)
387 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
388 endif
389
390 # Copy the PNG files.
391 define def_vbox_cp_images_pdf
392 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
393 $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/% : \
394 $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
395 $$(call MSG_L1,Copying temporary $$< => $$@)
396 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
397 endef
398 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
399
400
401 #################################################################################################################################
402 # SDKRef.pdf - xidl => Docbook => LaTeX => PDF #
403 #################################################################################################################################
404
405 VBOX_SDKREF_XML_FILES = SDKRef.xml
406
407 # Replace @a and @c with <tt> tags in VirtualBox.xidl.
408 $(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
409 $(call MSG_L1,Generating $@)
410 $(QUIET)$(SED) \
411 -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
412 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
413 --output $@ $<
414
415 # Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
416 $(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
417 $(call MSG_L1,Generating $@)
418 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
419
420 # Turn SDKRef.xml into LaTeX.
421 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
422 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
423 $(VBOX_MANUAL_APIREF_TMP) \
424 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
425 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run,) \
426 $(VBOX_XML_CATALOG) \
427 $(VBOX_XML_CATALOG_DOCBOOK) \
428 $(VBOX_XML_CATALOG_MANUAL) \
429 $(VBOX_XML_ENTITIES) \
430 $(MAKEFILE_CURRENT) \
431 | $$(dir $$@)
432 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
433 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
434 # generate TeX source from processed docbook and store it in SDKRef.tex.tmp
435 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
436 -o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
437 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
438 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
439 $(QUIET)$(SED) \
440 -e 's|^\\QUOTE{}|\\OQ{}|g' \
441 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
442 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
443 --output $@ $@.tmp
444 $(QUIET)$(RM) -f $@.tmp
445
446 # Turn SDKRef.tex into a PDF.
447 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf: \
448 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
449 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
450 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
451 | $$(dir $$@)
452 $(call MSG_L1,pdflatex $< (three passes))
453 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
454 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
455 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
456 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
457 $(QUIET)$(SED) -n \
458 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
459 $(basename $<).log
460 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
461
462 # Validating SDKRef.xml. It is invoked automatically at build time,
463 # but can also be manually invoked via the 'validate-sdkref' alias.
464 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run: \
465 $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml \
466 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
467 $(VBOX_MANUAL_APIREF_TMP) \
468 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
469 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
470 $(call MSG_L1,Validating $<)
471 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
472 $(QUIET)$(APPEND) -t "$@" "done"
473
474
475 # Handy aliases.
476 validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run
477 sdkref:: $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
478
479
480 #################################################################################################################################
481 # Accessibility.pdf - Docbook => LaTeX => PDF #
482 #################################################################################################################################
483
484 # Turn Accessibility.xml into LaTeX.
485 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex: \
486 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
487 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
488 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run,) \
489 $(VBOX_XML_CATALOG) \
490 $(VBOX_XML_CATALOG_DOCBOOK) \
491 $(VBOX_XML_CATALOG_MANUAL) \
492 $(VBOX_XML_ENTITIES) \
493 $(MAKEFILE_CURRENT) \
494 | $$(dir $$@)
495 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
496 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET))
497 # generate TeX source from processed docbook and store it in Accessibility.tex.tmp
498 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
499 -o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
500 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
501 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
502 $(QUIET)$(SED) \
503 -e 's|^\\QUOTE{}|\\OQ{}|g' \
504 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
505 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
506 --output $@ $@.tmp
507 $(QUIET)$(RM) -f $@.tmp
508
509 # Turn Accessibility.tex into a PDF.
510 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf: \
511 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex \
512 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
513 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
514 $(call MSG_L1,pdflatex $< (three passes))
515 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
516 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
517 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
518 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
519 $(QUIET)$(SED) -n \
520 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
521 $(basename $<).log
522 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
523
524 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html: \
525 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
526 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
527 $(VBOX_XML_CATALOG) \
528 $(VBOX_XML_CATALOG_DOCBOOK) \
529 $(VBOX_XML_CATALOG_MANUAL) \
530 $(VBOX_XML_ENTITIES) | $$(dir $$@)
531 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
532 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
533 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html \
534 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
535 $<
536
537 # Validating Accessibility.xml. It is invoked automatically at build time,
538 # but can also be manually invoked via the 'validate-accessibility' alias.
539 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run: \
540 $(VBOX_PATH_MANUAL_SRC)/en_US/Accessibility.xml \
541 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
542 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
543 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
544 $(call MSG_L1,Validating $<)
545 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
546 $(QUIET)$(APPEND) -t "$@" "done"
547
548
549 # Handy aliases.
550 validate-accessibility:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run
551 accessibility:: $(PATH_STAGE_BIN)/Accessibility.pdf
552 accessibility-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
553
554
555 #################################################################################################################################
556 # UserManual.* - The user manual in all its output variations (DITA-OT). #
557 #################################################################################################################################
558
559 #
560 # 1. We copy/hardlink all the files under <lang>/dita/* to the corresponding
561 # VBOX_PATH_MANUAL_OUTBASE location. This is mainly to deal with DITO-OT's
562 # inability to search for topic files in more than one place, so we have to
563 # gather generated and static topic sources + the .ditamap-file(s) in one
564 # place.
565 #
566
567 # Determine the basic set of files as dictated by the en_US version of the
568 # user manual (relative to $(lang)/dita). We'll use these to supply
569 # incomplete manual translations.
570 # Note! This includes .png as well as .dita and .ditamap files.
571 VBOX_USER_MANUAL_DITA_BASIC_SRC_FILES := \
572 $(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/*.ditamap)) \
573 $(addprefix topics/,$(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita))) \
574 $(addprefix topics/images/,$(notdir $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*png)))
575
576 ##
577 # Produce copying rules for one language and defining the variable
578 # VBOX_USER_MANUAL_DITA_STAGED_FILES_<lang> for use in prerequisite to
579 # anything producing a version of the user manual.
580 #
581 # @param 1 lang
582 define def_vbox_copy_manual_dita_src_files
583 VBOX_USER_MANUAL_DITA_SRC_FILES_$(1) := \
584 $$(notdir $$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$1/dita/*.ditamap)) \
585 $$(addprefix topics/,$$(notdir $$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$1/dita/topics/*dita))) \
586 $$(addprefix topics/images/,$$(notdir $$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$1/dita/topics/images/*png)))
587 VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)_FALLBACK := \
588 $$(filter-out $$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)), $$(VBOX_USER_MANUAL_DITA_BASIC_SRC_FILES))
589
590 VBOX_USER_MANUAL_DITA_STAGED_FILES_$(1) = \
591 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$1/dita/, \
592 $$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)) \
593 $$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)_FALLBACK) )
594
595 ifneq ($$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)),)
596 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$1/dita/,$$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1))): \
597 $$(VBOX_PATH_MANUAL_OUTBASE)/$1/dita/% : \
598 $$(VBOX_PATH_MANUAL_SRC)/$1/dita/% | $$$$(dir $$$$@)
599 $$(QUIET)$$(INSTALL_STAGING) -m 0644 -- "$$<" "$$(@D)/"
600 endif
601
602 ifneq ($$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)_FALLBACK),)
603 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$1/dita/,$$(VBOX_USER_MANUAL_DITA_SRC_FILES_$(1)_FALLBACK)): \
604 $$(VBOX_PATH_MANUAL_OUTBASE)/$1/dita/% : \
605 $$(VBOX_PATH_MANUAL_SRC)/en_US/dita/% | $$$$(dir $$$$@)
606 $$(QUIET)$$(INSTALL_STAGING) -m 0644 -- "$$<" "$$(@D)/"
607 endif
608
609 endef
610 $(foreach lang, $(VBOX_MANUAL_ALL_LANGUAGES),$(evalcall2 def_vbox_copy_manual_dita_src_files,$(lang)))
611
612
613 #
614 # 2. Convert the manpages from Docbook refentry files to DITA reference files.
615 #
616 # In DITA links needs proper href values, with both file and ID. Since the
617 # source only has IDs, we scan all topics and refentry-files alike and
618 # generate a mapping database before we start converting them. This DB is
619 # then used at the end of each conversion to fix the hrefs.
620 #
621
622 ##
623 # Do per-language stuff for the refentry -> dita file conversion.
624 #
625 # The variable VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_<lang> is defined
626 # by this define and should be expaneded as a prerequisite for any rule
627 # producing a version of the user manual.
628 #
629 # @param 1 Language.
630 #
631 define def_vbox_refentry_to_dita
632 # Generate a ID to FILE mapping database that def_vbox_refentry_to_dita can apply below.
633 VBOX_USER_MANUAL_ID_MAPPING_FILE_$(1) := $$(VBOX_PATH_MANUAL_OUTBASE)/$1/id-mapping-file.db
634 OTHER_CLEAN += $(VBOX_USER_MANUAL_ID_MAPPING_FILE_$(1))
635 $$(VBOX_USER_MANUAL_ID_MAPPING_FILE_$(1)) + $$(VBOX_USER_MANUAL_ID_MAPPING_FILE_$(1)).lst: \
636 $$(VBOX_PATH_MANUAL_SRC)/build_id_to_file_mapping.py \
637 $$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$1/*.xml) \
638 $$(filter %.dita,$$(VBOX_USER_MANUAL_DITA_STAGED_FILES_$(1))) \
639 | $$$$(dir $$$$@)
640 $$(call MSG_L1, $$<)
641 $$(QUIET)$$(APPEND) -nt "$$@.lst" $$(filter-out %.py,$$^)
642 $$(QUIET)$$(VBOX_BLD_PYTHON) "$$<" --output "$$@" @"$$@.lst"
643
644 # Accumulated list of conversion output file names to be used as a
645 # prerequisite in rules producing a version of the user manual.
646 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$1 :=
647
648 endef # def_vbox_refentry_to_dita
649
650 ## Convert a single refentry file to dita.
651 # @param 1 Language
652 # @param 2 Filename w/o extension.
653 # @param 3 Alternative fallback filename (for isomakercmd-man.xml).
654 # @note This produces more files that listed in the output, but we currently let kmk be ignorant of that.
655 define def_vbox_refentry_file_to_dita
656 VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$1 += $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2).ditamap
657 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2).ditamap \
658 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita \
659 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).xml: \
660 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita-pre.xsl \
661 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita.xsl \
662 $$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-to-single-topic.sh \
663 $$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-to-single-topic.xsl \
664 $$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-topic-ids.xsl \
665 $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
666 $$(VBOX_USER_MANUAL_ID_MAPPING_FILE_$1) \
667 $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2).xml) $(3) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2).xml) \
668 $$(VBOX_XML_CATALOG) \
669 $$(VBOX_XML_CATALOG_DOCBOOK) \
670 $$(VBOX_XML_CATALOG_MANUAL) \
671 $$(VBOX_XML_ENTITIES) \
672 $$(VBOX_VERSION_STAMP) \
673 | $$$$(dir $$$$@)
674 $$(call MSG_TOOL,xsltproc docbook-refentry-to-manual-dita[-pre].xsl,,$$(firstword $$(filter %.xml,$$^)),$$@)
675 $$(QUIET)$$(RM) -f -- "$$@" \
676 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).xml" \
677 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita"
678 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) \
679 --output "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).xml" \
680 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita-pre.xsl \
681 $$(qfirstfile , $$(qwildcard , $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2).xml) $(3) $$(VBOX_PATH_MANUAL_SRC)/en_US/$(2).xml)
682 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) \
683 $(if-expr defined(VBOX_DITA_USING_LATEST),--stringparam "g_fReplaceHypens" "true",) \
684 --output "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita" \
685 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita.xsl \
686 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).xml"
687 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/add_file_to_id_only_references.py \
688 --mapping-file "$$(VBOX_USER_MANUAL_ID_MAPPING_FILE_$1)" \
689 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita"
690 $$(QUIET)$$(ASH) \
691 "$$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-to-single-topic.sh" \
692 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita" \
693 "$$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-topic-ids.xsl" \
694 "$$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-to-single-topic.xsl" \
695 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics" \
696 -- $$(subst $$(REDIRECT),$$(REDIRECT_EXT),$$(call VBOX_XSLTPROC_WITH_CAT)) \
697 --path "$$(VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH)"
698 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) \
699 --path "$$(VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH)" \
700 --stringparam g_sMode map \
701 --output "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2).ditamap" \
702 $$(VBOX_PATH_MANUAL_SRC)/dita-refentry-flat-to-single-topic.xsl \
703 "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/flat-$(2).dita"
704
705 endef # def_vbox_refentry_file_to_dita
706
707 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES) \
708 ,$(evalcall2 def_vbox_refentry_to_dita,$(lang)) \
709 $(foreach file, $(basename $(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount man_VBoxHeadless) \
710 ,$(evalcall2 def_vbox_refentry_file_to_dita,$(lang),$(file))) \
711 $(evalcall2 def_vbox_refentry_file_to_dita,$(lang),user_isomakercmd-man, \
712 $(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
713
714 # Run conversion testcase.
715 refentry-to-dita-test:
716 $(RM) -f -- \
717 "$(VBOX_PATH_MANUAL_OUTBASE)/testcase-refentry1.xml" \
718 "$(VBOX_PATH_MANUAL_OUTBASE)/testcase-refentry1.dita"
719 $(call VBOX_XSLTPROC_WITH_CAT) \
720 --output "$(VBOX_PATH_MANUAL_OUTBASE)/testcase-refentry1.xml" \
721 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita-pre.xsl \
722 $(VBOX_PATH_MANUAL_SRC)/testcase/refentry1.xml
723 $(call VBOX_XSLTPROC_WITH_CAT) \
724 --output "$(VBOX_PATH_MANUAL_OUTBASE)/testcase-refentry1.dita" \
725 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-dita.xsl \
726 "$(VBOX_PATH_MANUAL_OUTBASE)/testcase-refentry1.xml"
727
728 #
729 # 2b. Generate the VBoxManage commands overview topic based upon the
730 # command synopis dita files generated in the above step.
731 #
732
733 # @param 1 Language
734 define def_vbox_generate_vboxmanage_overview
735 VBOX_USER_MANUAL_DITA_STAGED_FILES_$1 += $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/vboxmanage-cmd-overview.dita
736 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/vboxmanage-cmd-overview.dita \
737 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/vboxmanage-cmd-overview.dita.files.xml: \
738 $$(VBOX_PATH_MANUAL_SRC)/$(1)/vboxmanage-cmd-overview.xsl \
739 $$(VBOX_PATH_MANUAL_SRC)/vboxmanage-cmd-overview.xsl \
740 $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$(1)) \
741 | $$$$(dir $$$$@)
742 $$(call MSG_TOOL,xsltproc vboxmanage-cmd-overview.dita.xsl,,,$$@)
743 $$(QUIET)$$(RM) -f -- "$$@" "$$@.files.xml"
744 $$(APPEND) -tn "$$@.files.xml" '<?xml version="1.0"?>' '<files>'
745 $$(SED) -n \
746 -e 's/^.*topicref .*topics\/man_VBoxManage-\([^.]*\)\.ditamap.*$$(DOLLAR)/<file>vboxmanage-\1-synopsis.dita<\/file>/p' \
747 --append "$$@.files.xml" \
748 $(VBOX_PATH_MANUAL_SRC)/$(1)/dita/UserManual.ditamap
749 $$(APPEND) -n "$$@.files.xml" '</files>'
750 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --path "$$(VBOX_DITA_TECHNICAL_CONTENT_DTD_PATH)" \
751 --output "$$@" \
752 $$(VBOX_PATH_MANUAL_SRC)/$(1)/vboxmanage-cmd-overview.xsl \
753 "$$@.files.xml"
754
755 endef # def_vbox_generate_vboxmanage_overview
756 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(evalcall2 def_vbox_generate_vboxmanage_overview,$(lang)))
757
758
759 #
760 # 3. Convert the changelog from DocBook to a bunch of DITA topics and corresponding map.
761 #
762
763 ##
764 # @param 1 Language
765 # @note We don't really need to do this for each language, but whatever.
766 # @note Outputs a bunch of .dita files for each version too...
767 define def_vbox_convert_changelog_to_dita
768 VBOX_USER_MANUAL_DITA_STAGED_FILES_$1 += $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/changelog-versions.ditamap
769 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/changelog-versions.ditamap: \
770 $$(VBOX_PATH_MANUAL_SRC)/docbook-changelog-to-manual-dita.sh \
771 $$(VBOX_PATH_MANUAL_SRC)/docbook-changelog-to-manual-dita.xsl \
772 $$(VBOX_XML_CATALOG) \
773 $$(VBOX_XML_CATALOG_DOCBOOK) \
774 $$(VBOX_XML_CATALOG_MANUAL) \
775 | $$$$(dir $$$$@)
776 $$(call MSG_TOOL,xsltproc docbook-changelog-to-manual-dita.xsl,,,$$@)
777 $$(QUIET)$$(RM) -f -- "$$@" "$$@.files.xml"
778 $$(QUIET)$$(ASH) \
779 $$(VBOX_PATH_MANUAL_SRC)/docbook-changelog-to-manual-dita.sh \
780 $$(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml \
781 $$(VBOX_PATH_MANUAL_SRC)/docbook-changelog-to-manual-dita.xsl \
782 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics \
783 -- \
784 $$(call VBOX_XSLTPROC_WITH_CAT)
785 endef # def_vbox_convert_changelog_to_dita
786 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(evalcall2 def_vbox_convert_changelog_to_dita,$(lang)))
787
788
789 #
790 # 4a. UserManual.pdf - Run dost.jar from DITA-OT to produce the PDF version.
791 #
792 # Note! The /tempdir is deleted, recreated, used and deleted again for each
793 # run. So, be careful where you point it.
794 # Note! This crappy utility may fail to find files (or fail to parse the
795 # command line) and still return a successfully (0) exit code.
796 #
797 define def_ditamap_to_pdf
798 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf \
799 + $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log \
800 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.list \
801 +| $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita.xml.properties: \
802 $$(VBOX_MANUAL_XML_FILES_COMMON) \
803 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
804 $$(VBOX_USER_MANUAL_DITA_STAGED_FILES_$(lang)) \
805 $$(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$(lang)) \
806 $$(VBOX_PATH_MANUAL_SRC)/pdf-theme-UserManual.yaml \
807 $$(VBOX_PATH_MANUAL_SRC)/en_US/images/vboxlogo.png
808 $$(QUIET)$$(RM) -f -- "$$@" "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log"
809 $$(QUIET)$$(RM) -Rf -- "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf/"
810 $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-pdf,, \
811 "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
812 "/transtype:pdf" \
813 "/filter:$$(VBOX_PATH_MANUAL_SRC)/$(1)/dita/ohc.ditaval" \
814 "/outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)" \
815 "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_pdf" \
816 , \
817 "/grammarcache:yes" \
818 $(if-expr defined(VBOX_DITA_DEBUG),"/cleantemp:no" "/debug:yes",) \
819 , \
820 "--theme=$$(VBOX_PATH_MANUAL_SRC)/pdf-theme-UserManual.yaml" \
821 "--logfile=$$(@D)/UserManual_pdf.log" \
822 $(if-expr defined(VBOX_DITA_DEBUG),"--clean.temp=no",) \
823 )
824
825 ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf
826 .PRECIOUS: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual_pdf.log
827 endef
828 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(evalcall2 def_ditamap_to_pdf,$(lang)))
829
830 # Useful aliases
831 usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
832
833
834 #
835 # 4b. UserManual.html - Run dost.jar from DITA-OT to produce the HTML versions.
836 #
837 # We produce both chunked and singled paged HTML versions of the en_US manual
838 # mainly for uploading to virtualbox.org. The docs build box produces a zip
839 # including these.
840 #
841
842 ## @todo front page
843 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
844 $(VBOX_USER_MANUAL_DITA_STAGED_FILES_en_US) \
845 $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_en_US)
846 $(call MSG_L1,Building html chunks $@)
847 $(QUIET)$(RM) -Rf -- "$(@D)" "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks/"
848 $(QUIET)$(MKDIR) -- "$(@D)"
849 $(QUIET)$(call VBOX_DITA_RUN_DOST,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-chunks,, \
850 "/i:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap" \
851 "/transtype:xhtml" \
852 "/filter:$(VBOX_PATH_MANUAL_SRC)/en_US/dita/htmlhelp.ditaval" \
853 "/outdir:$(@D)" \
854 "/tempdir:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/temp_xhtml_chunks" \
855 , \
856 "/grammarcache:yes" \
857 , \
858 "--logfile=$(@D)/UserManual_xhtml.log")
859
860 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
861
862 # We must modify UserManual.ditamap here, removing all chunk attributes and put
863 # a chunk="to-content" on the root element (bookmap). For clues see:
864 # https://docs.oasis-open.org/dita/v1.2/os/spec/archSpec/chunking.html
865 # https://www.oxygenxml.com/forum/post25114.html?hilit=dita%20xhtml%20chunk#p25114
866 # We stich the index.html and UserManual-Single.html files together using
867 # SED since we haven't been able to convince DITA-OT to combine them.
868 ## @todo front page
869 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
870 $(VBOX_USER_MANUAL_DITA_STAGED_FILES_en_US) \
871 $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_en_US)
872 $(call MSG_L1,Building html chunks $@)
873 $(QUIET)$(RM) -f -- "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual-Single.ditamap"
874 $(SED) -r -e 's/ chunk=["][^"]+["]//g' -e 's/<bookmap /<bookmap chunk="to-content" /' \
875 --output "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual-Single.ditamap" \
876 "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap"
877 $(QUIET)$(RM) -Rf -- "$(@D)" "$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-single/"
878 $(QUIET)$(MKDIR) -- "$(@D)"
879 $(QUIET)$(call VBOX_DITA_RUN_DOST,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-html-single,, \
880 "/i:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual-Single.ditamap" \
881 "/transtype:xhtml" \
882 "/outdir:$(@D)" \
883 "/tempdir:$(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/temp_xhtml_single" \
884 , \
885 "/grammarcache:yes" \
886 , \
887 "--logfile=$(@D)/UserManual-Single_xhtml.log")
888 $(SED) -ne '1,/<body>/{p}' \
889 --output "$@" "$(@D)/UserManual-Single.html"
890 $(APPEND) -n "$@" "<!-- index inject: -->"
891 $(SED) -ne '/<body>/,/<\/body>/{/<body>/d;/<\/body>/d;s/UserManual-Single.html/UserManual.html/g;p}' \
892 --append "$@" "$(@D)/index.html"
893 $(APPEND) -n "$@" "<!-- resuming main file: -->"
894 $(SED) -ne '/<body>/,99999999{/<body>/d;s/UserManual-Single.html/UserManual.html/g;p}' \
895 --append "$@" "$(@D)/UserManual-Single.html"
896
897 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
898
899 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
900 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
901 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
902 $(call MSG_L1,Packing documentation $@)
903 $(QUIET)$(RM) -f $@
904 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- $(VBOX_ZIP) \
905 -9 -r "$@" \
906 "html-chunks" \
907 "html-single" \
908 -x "html-chunks/dita.list" \
909 -x "html-chunks/dita.xml.properties" \
910 -x "html-chunks/UserManual_xhtml.log" \
911 -x "html-single/dita.list" \
912 -x "html-single/dita.xml.properties" \
913 -x "html-single/UserManual-Single_xhtml.log" \
914 -x "html-single/index.html" \
915 -x "html-single/UserManual-Single.html"
916
917 html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
918
919
920 #
921 # A few things which are shared between htmlhelp and qhelp docs.
922 # TODO: This is Docbook related work. Left here in case we can reuse some of
923 # the ideas from it for DITA-OT.
924 #
925
926 VBOX_DOCBOOK_HTMLHELP_FORMATCFG = \
927 $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
928 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
929 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
930
931 # Prepare the XSL file for our title page, htmlhelp and qhelp variant.
932 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl: \
933 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
934 $(call MSG_L1,xsltproc $<)
935 $(QUIET)$(RM) -f $@.tmp $@
936 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o $@.tmp $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
937 $(QUIET)$(MV) -f $@.tmp $@
938
939 # end old stuff.
940
941 if defined(VBOX_WITH_DOCS_QHELP) && !defined(VBOX_ONLY_SDK)
942 #
943 # 4c. VirtualBox.qch + VirtualBox.qhc - Qt compressed help and collection file.
944 #
945 # See usermanual.pdf under DITA-OT-xxxxx/doc folder for details.
946 #
947
948 # Enable Qt and locate the Qt help generator.
949 ifdef VBOX_WITH_QT6
950 USES += qt6
951 VBOX_QHELPGENERATOR = $(PATH_TOOL_QT6_LIBEXEC)/qhelpgenerator
952 else
953 USES += qt5
954 VBOX_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')
955 VBOX_QHELPGENERATOR = $(PATH_TOOL_QT5_BIN)/$(if-expr $(VBOX_QHELPGENERATOR_VERSION_MINOR) >= 12,qhelpgenerator,qcollectiongenerator)
956 endif
957
958 ## Build QHelp version of manual for given language.
959 # @param 1 Language
960 # @param 2 The language specific qhelp output directory.
961 define def_vbox_usermanual_as_qhelp
962
963 # 1. Generate UserManual.hpp using DITA-OT.
964 #
965 # Setting HHCDIR here so that it fails to locate hcc.exe and always skips the
966 # compilation step that produces the .chm-file, since we don't need it and it
967 # mangles the path so it always fails anyway.
968 ## @todo front page.
969 $(2)/UserManual.hhp: \
970 $(VBOX_USER_MANUAL_DITA_STAGED_FILES_$(1)) \
971 $(VBOX_USER_MANUAL_CONVERTED_REFENTRY_DITA_FILES_$(1))
972 $$(call MSG_L1,dita-ot-qhelp, => $$@)
973 $$(QUIET)$$(RM) -Rf -- "$$(@D)" "$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp/"
974 $$(QUIET)$$(MKDIR) -- "$$(@D)"
975 $$(QUIET)$$(call VBOX_DITA_RUN_DOST,$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita-ot-qhelp, -EHHCDIR="$$(@D)", \
976 "/i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap" \
977 "/transtype:htmlhelp" \
978 "/filter:$$(VBOX_PATH_MANUAL_SRC)/$(1)/dita/htmlhelp.ditaval" \
979 "/outdir:$(2)" \
980 "/tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp_qhelp" \
981 , \
982 "/grammarcache:yes" \
983 , \
984 "--logfile=$(2)/UserManual_htmlhelp.log")
985
986
987 ditamap-to-htmlhelp: $(2)/UserManual.hhp
988
989 # 2. Generate a Qt Help Project file (QHP) using htmlhelp-qthelp.py.
990 $(2)/UserManual.qhp: \
991 $(2)/UserManual.hhp \
992 $$(VBOX_PATH_MANUAL_SRC)/htmlhelp-qthelp.py \
993 | $$$$(dir $$$$@)
994 $$(call MSG_L1,htmlhelp-qthelp.py $$<,=> $$@)
995 $$(QUIET)$$(RM) -f -- "$$@"
996 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/htmlhelp-qthelp.py \
997 -d "$$(<D)" -o "$$@" -f UserManual.hhp -t UserManual.hhc
998
999 # 3. Copy the Qt help configuration file from source to the output dir.
1000 $(2)/UserManual.qhcp: \
1001 $$(VBOX_PATH_MANUAL_SRC)/UserManual.qhcp \
1002 | $(2)/UserManual.hhp # (Must not run parallel to UserManual.hpp, so it can safely nuke the output dir.)
1003 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
1004
1005 # 4. Run the Qt help generator to produce the .qhc and .qch files.
1006 $(2)/UserManual.qch \
1007 + $(2)/UserManual.qhc: \
1008 $(2)/UserManual.qhcp \
1009 $(2)/UserManual.qhp \
1010 | $$$$(dir $$$$@)
1011 $$(call MSG_L1,$$(notdir $$(VBOX_QHELPGENERATOR)) $$<,=> $$@)
1012 $$(QUIET)$$(RM) -f -- "$$@"
1013 ifdef VBOX_WITH_QT6
1014 $$(QUIET)$$(REDIRECT) -- $$(VBOX_QHELPGENERATOR) $$<
1015 else
1016 $$(QUIET)$$(REDIRECT) -E QT_QPA_PLATFORM_PLUGIN_PATH=$$(PATH_SDK_QT5)/plugins -- $$(VBOX_QHELPGENERATOR) $$<
1017 endif
1018 $$(call MSG_L1,Fresh QCH is now at $$@)
1019
1020 endef # def_vbox_usermanual_as_qhelp
1021
1022 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES) \
1023 ,$(evalcall2 def_vbox_usermanual_as_qhelp,$(lang),$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/qhelp))
1024
1025 qhelp:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/, $(VBOX_QHELP_OUTPUT_FILES))
1026
1027 endif # VBOX_WITH_DOCS_QHELP && !VBOX_ONLY_SDK
1028
1029
1030 #################################################################################################################################
1031 # Miscellaneous #
1032 #################################################################################################################################
1033
1034 #
1035 # ChangeLog.html
1036 #
1037 # This XSLT rule formats en_US/user_ChangeLog.xml (which includes the actual change log
1038 # contained in user_ChangeLogImpl.xml) as a standalone HTML file.
1039 #
1040 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
1041 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
1042 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
1043 $(VBOX_XML_CATALOG) \
1044 $(VBOX_XML_CATALOG_DOCBOOK) \
1045 $(VBOX_XML_CATALOG_MANUAL) \
1046 $(VBOX_XML_ENTITIES) | $$(dir $$@)
1047 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
1048 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
1049 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
1050
1051 cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
1052
1053
1054 #
1055 # VBoxManage man pages (parts also required by VBoxManage built-in help).
1056 #
1057
1058 ##
1059 # Emits rules for preprocessing refentry sources (applying remarks element),
1060 # and for producing the actual man pages.
1061 # $(evalcall2 def_vbox_refentry_to_manpage)
1062 # @param 1 The language
1063 # @param 2 The file name (no path).
1064 define def_vbox_refentry_to_manpage
1065 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
1066 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
1067 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
1068 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) \
1069 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
1070 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
1071 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
1072 $$(QUIET)$$(RM) -f "$$@"
1073 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
1074 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
1075 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@.tmp $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) $$@
1076 $$(QUIET)$$(MV) -f -- "$$@.tmp" "$$@"
1077 if defined(VBOX_HAVE_XMLLINT)
1078 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
1079 endif
1080
1081 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
1082 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
1083 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl \
1084 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
1085 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
1086 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
1087 $$(QUIET)$$(RM) -f "$$@"
1088 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl $$<
1089 endef
1090 $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
1091 , $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
1092
1093 # Handy aliases.
1094 validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
1095 man-experiment:: $(foreach lang,$(VBOX_MANUAL_ALL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
1096 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
1097
1098 #
1099 # Manually updating the DHCP option list taken from VirtualBox.xidl
1100 #
1101 dhcpoptions: $(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xsl \
1102 $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
1103 $(call VBOX_XSLTPROC) --output "$(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml" $^
1104
1105
1106 #
1107 # Packing the docs into a zip file (part of the packing pass on the docs build box).
1108 #
1109 ifneq ($(VBOX_MANUAL_PACK),)
1110 $(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
1111 $(call MSG_L1,Packing documentation $@)
1112 $(QUIET)$(RM) -f $@
1113 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
1114 endif
1115
1116
1117endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
1118
1119include $(FILE_KBUILD_SUB_FOOTER)
1120
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