VirtualBox

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

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

Docs: bugref:10302. Adding a seperate section to the makefile for common dita work.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 47.6 KB
Line 
1# $Id: Makefile.kmk 98894 2023-03-09 14:37:19Z 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# -- VirtualBox.chm
35#
36# Both files end up in PATH_STAGE_BIN.
37#
38# Both targets indirectly depend on the XML files in this directory;
39# "indirectly" because we first copy them to PATH_TARGET and hack them
40# up a bit for variable substitution and such (see below).
41# The toolchains are roughly like this:
42#
43# -- PDF file via Apache FOP: pre-process the XML files in PATH_TARGET,
44# then create a .FO file (another XML format for "formatted objects")
45# via xsltproc, then feed the .FO file to Apache FOP to create the PDF.
46#
47# -- PDF file via LaTeX: pre-process the XML files in PATH_TARGET, then
48# run our custom "dblatex" perl script on UserManual.xml, which parses
49# the XML (using the Perl SAX parsers) and dumps a matching LaTeX file
50# to UserManual.tex. This is then regularly processed by pdflatex to
51# generate PDF.
52#
53# -- CHM file: again, pre-process the XML files in PATH_TARGET, then use
54# xsltproc to create a .HHP file for the Microsoft Help Compiler, then
55# feed that file to it.
56#
57
58SUB_DEPTH = ../..
59include $(KBUILD_PATH)/subheader.kmk
60
61ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
62 include $(PATH_SUB_CURRENT)/Config.kmk
63endif
64
65
66#
67# Globals
68#
69
70# Error out if someone tries to override old globals.
71ifdef HTMLHELPOPTS
72 $(error HTMLHELPOPTS was renamed to VBOX_HTMLHELP_OPTS!)
73endif
74ifdef DOCBOOKPATH
75 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
76endif
77ifdef DOCBOOKPATH
78 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
79endif
80ifdef XML_CATALOG
81 $(error XML_CATALOG was renamed to VBOX_XML_CATALOG!)
82endif
83ifdef XML_CATALOG_DOCBOOK
84 $(error XML_CATALOG_DOCBOOK was renamed to VBOX_XML_CATALOG_DOCBOOK!)
85endif
86ifdef PDFLATEX_INTERACTION
87 $(error PDFLATEX_INTERACTION was renamed to VBOX_PDFLATEX_INTERACTION!)
88endif
89ifdef PDFLATEX
90 $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
91endif
92ifdef HHC
93 $(error HHC was renamed to VBOX_HHC!)
94endif
95
96VBOX_DITA_CONVERTER_PATH = $(PATH_ROOT)/src/libs/dbdita-1.0
97VBOX_DITA_ORIGINAL_PATH = $(PATH_ROOT)/src/libs/dita-ot-1.8.5
98VBOX_DITA_PATH = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita-ot-1.8.5
99
100VBOX_QHELP_OUTPUT_FILES = \
101 UserManual.qch \
102 UserManual.qhc
103
104# VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
105# without catting the log a million times.
106VBOX_PDFLATEX_INTERACTION ?= batchmode
107ifeq ($(KBUILD_HOST),win)
108 ifndef VBOX_PDFLATEX
109 VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
110 ifneq ($(VBOX_PDFLATEX),)
111 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
112 endif
113 endif
114 ifndef VBOX_PDFLATEX
115 # Tell MiKTeX to automatically download packages if system wide install.
116 VBOX_PDFLATEX := pdflatex
117 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
118 endif
119else
120 VBOX_PDFLATEX ?= pdflatex
121 VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
122 VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
123endif
124
125# Windows HTML Help Workshop compiler (stupid thing always returns an error!)
126VBOX_HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
127
128
129# Additional xsltproc options when generating
130VBOX_HTMLHELP_OPTS ?=
131
132# SDK related globals.
133VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
134VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
135VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
136
137
138#
139# Targets
140#
141
142BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
143
144if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
145 if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
146 INSTALLS += VBox-docs-sdkref
147 endif
148
149 ifdef VBOX_WITH_DOCS_HTML
150 INSTALLS += VBox-docs-usermanual-html
151 VBOX_PATH_BIN_HTML = $(PATH_STAGE_BIN)/UserManual-html.zip
152 else # Do not build html.
153 VBOX_PATH_BIN_HTML =
154 endif
155
156 ifdef VBOX_WITH_DOCS_CHM
157 INSTALLS += VBox-docs-usermanual-chm
158 VBOX_PATH_BIN_CHM = $(PATH_STAGE_BIN)/VirtualBox.chm
159 else # Do not build chm.
160 VBOX_PATH_BIN_CHM =
161 endif
162
163 ifdef VBOX_WITH_DOCS_QHELP
164 INSTALLS += VBox-docs-usermanual-qhc
165 INSTALLS += VBox-docs-usermanual-qch
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 = $(PATH_STAGE_BIN)/UserManual.qch
177 VBOX_PATH_BIN_QHELP += $(PATH_STAGE_BIN)/UserManual.qhc
178 else # Do not install/pack qhelp.
179 VBOX_PATH_BIN_QHELP =
180 endif
181
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_CHM) \
188 $(VBOX_PATH_BIN_QHELP)
189 INSTALLS += VBox-docs-usermanual
190
191 ifdef VBOX_WITH_DOCS_TRANSLATIONS
192 INSTALLS += VBox-docs-usermanual-l10n
193 VBOX_MANUAL_PACK += \
194 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
195 ifdef VBOX_WITH_DOCS_CHM
196 INSTALLS += VBox-docs-usermanual-l10n-chm
197 VBOX_MANUAL_PACK += \
198 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
199 endif
200 endif
201 endif # !VBOX_ONLY_SDK
202
203 ifdef VBOX_WITH_DOCS_ACCESSIBILITY
204 INSTALLS += VBox-docs-accessibility
205 INSTALLS += VBox-docs-accessibility-html
206 endif
207
208 ifdef VBOX_ONLY_DOCS
209 PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
210 endif
211
212 ifdef VBOX_WITH_DOCS_TRANSLATIONS
213 VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
214 endif
215
216 $(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
217 $(eval VBOX_MANUAL_XML_FILES_GENERATED_$$(lang) := \
218 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
219 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
220 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_man_VBoxHeadless.xml \
221 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_man_vboximg-mount.xml \
222 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_isomakercmd-man.xml))
223
224 VBOX_SDKREF_XML_FILES = \
225 SDKRef.xml
226
227 VBOX_ACCESSIBILITY_XML_FILES = \
228 Accessibility.xml
229
230
231 # Wildcard the images path for every supported language
232 $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
233 $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
234
235 VBOX_MANUAL_TEX_UNICODE_FILES = \
236 $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
237
238 VBOX_MANUAL_LATEX_FILES_TARGET = \
239 $(addprefix UserManual.,aux log out toc tex)
240
241 VBOX_SDKREF_LATEX_FILES_TARGET = \
242 $(addprefix SDKRef.,aux log out toc tex)
243
244 VBOX_ACCESSIBILITY_LATEX_FILES_TARGET = \
245 $(addprefix Accessibility.,aux log out toc tex)
246
247 BLDDIRS += \
248 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, \
249 $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
250 $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
251 $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
252 $(addsuffix /qhelp, $(VBOX_MANUAL_LANGUAGES)) \
253 $(addsuffix /qhelp/images, $(VBOX_MANUAL_LANGUAGES)) \
254 $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
255 $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
256 )
257
258 # Explicit cleaning has some overlap with default cleaning rules, since this
259 # Makefile is using very complex conditionals for selectively creating
260 # specific files, and not everyone remembers to use the same with "kmk clean".
261 OTHER_CLEAN += \
262 $(VBOX_XML_CATALOG) \
263 $(VBOX_XML_CATALOG_DOCBOOK) \
264 $(VBOX_XML_CATALOG_MANUAL) \
265 $(VBOX_XML_ENTITIES) \
266 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
267 $(VBOX_XML_XREF_TO_TEXT) \
268 $(VBOX_XML_XREF_TO_TEXT).cat \
269 $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
270 $(VBOX_MANUAL_XML_REFENTRY_FILES) \
271 $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
272 man_VBoxHeadless.xml \
273 user_man_VBoxHeadless.xml \
274 man_vboximg-mount.xml \
275 user_man_vboximg-mount.xml \
276 isomakercmd-man.xml \
277 user_isomakercmd-man.xml \
278 $(VBOX_MANUAL_LATEX_FILES_TARGET) \
279 $(VBOX_MANUAL_PNG_FILES_$(lang)) \
280 $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
281 $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
282 $(addprefix qhelp/, $(VBOX_MANUAL_PNG_FILES_$(lang))) \
283 html-single/UserManual.html \
284 $(addprefix qhelp/, UserManual.qhp UserManual.qhcp $(VBOX_QHELP_OUTPUT_FILES)) \
285 $(addprefix HTMLHelp/, index.html go01.html) \
286 $(addprefix qhelp/, index.html go01.html) \
287 $(addprefix html-chunks/, index.html go01.html) \
288 $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
289 ,html-chunks/ch$(n).html \
290 html-chunks/re$(n).html \
291 HTMLHelp/ch$(n).html \
292 HTMLHelp/re$(n).html \
293 $(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)) \
294 qhelp/ch$(n).html \
295 qhelp/re$(n).html \
296 $(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)) ) \
297 $(foreach n,a b c \
298 ,html-chunks/ap$(n).html \
299 HTMLHelp/ap$(n).html \
300 $(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) \
301 qhelp/ap$(n).html \
302 $(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) ) \
303 $(foreach n,01 02 03 04 05 \
304 ,html-chunks/pr$(n).html \
305 HTMLHelp/pr$(n).html \
306 $(foreach s,01 02 03 04 05 06 07 08,HTMLHelp/pr$(n)s$(s).html) \
307 qhelp/pr$(n).html \
308 $(foreach s,01 02 03 04 05 06 07 08,qhelp/pr$(n)s$(s).html) ) \
309 HTMLHelp/toc.hhc \
310 HTMLHelp/htmlhelp.hhp \
311 qhelp/toc.hhc \
312 qhelp/htmlhelp.hhp \
313 UserManual.pdf \
314 VirtualBox.chm \
315 $(VBOX_QHELP_OUTPUT_FILES) \
316 ChangeLog.html \
317 validatemanual.run \
318 validateaccessibility.run \
319 validatesdkref.run \
320 )) \
321 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
322 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
323 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
324 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
325 $(PATH_STAGE_BIN)/UserManual.pdf \
326 $(PATH_STAGE_BIN)/VirtualBox.chm \
327 \
328 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
329 $(VBOX_SDKREF_LATEX_FILES_TARGET) \
330 SDKRef.pdf \
331 ) \
332 $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf \
333 \
334 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
335 $(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET) \
336 html-single/Accessibility.html \
337 Accessibility.pdf \
338 ) \
339 $(PATH_STAGE_BIN)/Accessibility.html \
340 $(PATH_STAGE_BIN)/Accessibility.pdf \
341 \
342 $(VBOX_DOC_XIDL_SRC_TMP) \
343 $(VBOX_MANUAL_APIREF_TMP)
344
345endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
346
347#
348# target for installing UserManual.pdf
349#
350VBox-docs-usermanual_INST = $(INST_BIN)
351VBox-docs-usermanual_MODE = a+r,u+w
352VBox-docs-usermanual_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf
353
354VBox-docs-usermanual-qhc_INST = $(INST_BIN)
355VBox-docs-usermanual-qhc_MODE = a+r,u+w
356VBox-docs-usermanual-qhc_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qhc
357
358VBox-docs-usermanual-qch_INST = $(INST_BIN)
359VBox-docs-usermanual-qch_MODE = a+r,u+w
360VBox-docs-usermanual-qch_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/UserManual.qch
361
362#
363# target for installing translated UserManual_*.pdf
364#
365VBox-docs-usermanual-l10n_INST = $(INST_BIN)
366VBox-docs-usermanual-l10n_MODE = a+r,u+w
367VBox-docs-usermanual-l10n_SOURCES = $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/UserManual.pdf=>UserManual_$(f).pdf)
368
369#
370# target for installing the chunked HTML docs
371#
372VBox-docs-usermanual-html_INST = $(INST_BIN)
373VBox-docs-usermanual-html_MODE = a+r,u+w
374VBox-docs-usermanual-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip=>UserManual-html.zip
375
376#
377# target for installing VirtualBox.chm
378#
379VBox-docs-usermanual-chm_INST = $(INST_BIN)
380VBox-docs-usermanual-chm_MODE = a+r,u+w
381VBox-docs-usermanual-chm_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.chm
382
383#
384# target for installing translated VirtualBox_*.chm
385#
386VBox-docs-usermanual-l10n-chm_INST = $(INST_BIN)
387VBox-docs-usermanual-l10n-chm_MODE = a+r,u+w
388VBox-docs-usermanual-l10n-chm_SOURCES = $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/VirtualBox.chm=>VirtualBox_$(f).chm)
389
390#
391# target for installing SDKRef.pdf
392#
393VBox-docs-sdkref_INST = $(INST_SDK)docs/
394VBox-docs-sdkref_MODE = a+r,u+w
395VBox-docs-sdkref_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf
396
397#
398# target for installing Accessibility.pdf
399#
400VBox-docs-accessibility_INST = $(INST_BIN)
401VBox-docs-accessibility_MODE = a+r,u+w
402VBox-docs-accessibility_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf
403
404#
405# target for installing Accessibility.html
406#
407VBox-docs-accessibility-html_INST = $(INST_BIN)
408VBox-docs-accessibility-html_MODE = a+r,u+w
409VBox-docs-accessibility-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
410
411if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
412
413 ##
414 # Morph man pages into manual sections.
415 # $(evalcall2 def_vbox_refentry_to_user_sect1)
416 # @param 1 Language.
417 # @param 2 the refentry xml base file name.
418 # @param 3 the full refentry xml file path.
419 define def_vbox_refentry_to_user_sect1
420 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): $(3) \
421 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
422 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
423 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
424 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(filter %.xml,$$^),$$@)
425 $$(QUIET)$$(RM) -f "$$@"
426 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
427 endef
428 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
429man_VBoxHeadless.xml \
430man_vboximg-mount.xml \
431, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file),$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file))))
432 $(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
433,$(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),isomakercmd-man.xml,$(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
434
435
436 # Generates the VBoxManage command overview include file (shared between
437 # languages) from the refsynopsisdiv section of the man pages.
438 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
439 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
440 $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
441 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
442 $(VBOX_XML_ENTITIES) | $$(dir $$@)
443 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
444 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
445
446
447
448
449
450 ##########################################################################################
451 #
452 # Shared rules for PDF generation
453 #
454 ##########################################################################################
455
456 ifndef VBOX_OSE
457 # copy ucs.sty and related files
458 $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
459 $(call MSG_L1,Copying unicode support for LaTeX)
460 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
461 endif
462
463 # copy the PNG files.
464 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
465 define def_vbox_cp_images_pdf
466 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
467 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
468 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
469 $$(call MSG_L1,Copying temporary $$< => $$@)
470 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
471 endef
472 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
473
474
475 ##########################################################################################
476 #
477 # UserManual.pdf
478 #
479 ##########################################################################################
480
481 ifdef PDF_FROM_LATEX
482 # Generate PDF from LaTeX
483 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
484 define def_vbox_usermanual_tex_to_pdf
485 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
486 $$(out_dir)/UserManual.pdf: \
487 $$(out_dir)/UserManual.tex \
488 $$(if $$(VBOX_OSE),,$$(out_dir)/ucs.sty) \
489 $$(addprefix $$(out_dir)/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) | $$$$(dir $$$$@)
490 # PDF generation via Latex: generate the .tex file
491 $$(call MSG_L1,pdflatex $$< (four passes) -> $$@)
492 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
493 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
494 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
495 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
496 $$(QUIET)$$(SED) -ne '/Warning: Hyper reference/p' $$(basename $$<).log
497 $$(QUIET)$$(SED) -n \
498 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
499 $$(basename $$@).log
500 $$(call MSG_L1,Fresh LaTeX-generated PDF is now at $$@)
501 endef
502 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_tex_to_pdf))
503 endif
504
505 # Generate LaTeX from XML
506 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
507 define def_vbox_usermanual_xml_to_tex
508 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
509 $$(out_dir)/UserManual.tex: \
510 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
511 $$(VBOX_MANUAL_XML_FILES_COMMON) \
512 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
513 $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
514 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
515 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
516 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
517 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(firstword $$(filter %.xml,$$^)),$$@)
518 $$(QUIET)$$(RM) -f $$(addprefix $$(@D)/,$$(VBOX_MANUAL_LATEX_FILES_TARGET))
519 # generate TeX source from processed docbook and store it in UserManual.tex.tmp;
520 # pass current language to xsltproc in TARGETLANG variable
521 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG $(lang) \
522 -o [email protected] $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $$<
523 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
524 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
525 $$(QUIET)$$(SED) \
526 -e 's|^\\QUOTE{}|\\OQ{}|g' \
527 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
528 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
529 --output $$@ [email protected]
530 $$(QUIET)$$(RM) -f [email protected]
531 endef
532 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_tex))
533
534 # Useful aliases
535 usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
536
537 debug-usermanual:
538 $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
539
540 #
541 # Generate rules for validating the UserManual.xml. These are invoked
542 # automatically at build time, but can also be manually invoked via the
543 # 'validatemanual' and 'validatemanual_<lang>' aliases.
544 #
545 define def_vbox_validate_xml
546 validatemanual_$(lang):: $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run
547 $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run: \
548 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
549 $$(VBOX_MANUAL_XML_FILES_COMMON) \
550 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
551 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
552 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
553 $$(call MSG_L1,Validating $$<)
554 $$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$<
555 $$(QUIET)$$(APPEND) -t "$$@" "done"
556 endef
557 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_validate_xml))
558
559
560 # Handy aliases.
561 validatemanual:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),validatemanual_$(lang))
562
563
564
565 #
566 # SDKRef.pdf
567 #
568
569 # Replace <tt> tags in VirtualBox.xidl.
570 $(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
571 $(call MSG_L1,Generating $@)
572 $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
573 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
574 --output $@ $<
575
576 # Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
577 $(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
578 $(call MSG_L1,Generating $@)
579 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
580
581 # Turn SDKRef.xml into LaTeX.
582 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
583 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
584 $(VBOX_MANUAL_APIREF_TMP) \
585 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
586 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run,) \
587 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
588 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
589 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
590 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
591 # generate TeX source from processed docbook and store it in SDKRef.tex.tmp
592 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
593 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
594 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
595 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
596 $(QUIET)$(SED) \
597 -e 's|^\\QUOTE{}|\\OQ{}|g' \
598 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
599 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
600 --output $@ [email protected]
601 $(QUIET)$(RM) -f [email protected]
602
603 # Turn SDKRef.tex into a PDF.
604 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf: \
605 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
606 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
607 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
608 $(call MSG_L1,pdflatex $< (three passes))
609 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
610 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
611 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
612 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
613 $(QUIET)$(SED) -n \
614 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
615 $(basename $<).log
616 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
617
618 # Validating SDKRef.xml. It is invoked automatically at build time,
619 # but can also be manually invoked via the 'validate-sdkref' alias.
620 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run: \
621 $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml \
622 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
623 $(VBOX_MANUAL_APIREF_TMP) \
624 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
625 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
626 $(call MSG_L1,Validating $<)
627 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
628 $(QUIET)$(APPEND) -t "$@" "done"
629
630
631 # Handy aliases.
632 validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run
633 sdkref:: $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
634
635
636
637 #
638 # Accessibility.pdf
639 #
640
641 # Turn Accessibility.xml into LaTeX.
642 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex: \
643 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
644 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
645 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run,) \
646 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
647 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
648 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
649 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET))
650 # generate TeX source from processed docbook and store it in Accessibility.tex.tmp
651 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
652 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
653 # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
654 # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
655 $(QUIET)$(SED) \
656 -e 's|^\\QUOTE{}|\\OQ{}|g' \
657 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
658 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
659 --output $@ [email protected]
660 $(QUIET)$(RM) -f [email protected]
661
662 # Turn Accessibility.tex into a PDF.
663 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf: \
664 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex \
665 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
666 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
667 $(call MSG_L1,pdflatex $< (three passes))
668 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
669 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
670 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
671 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
672 $(QUIET)$(SED) -n \
673 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
674 $(basename $<).log
675 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
676
677 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html: \
678 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
679 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
680 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
681 $(VBOX_XML_ENTITIES) | $$(dir $$@)
682 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
683 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
684 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html \
685 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
686 $<
687
688 # Validating Accessibility.xml. It is invoked automatically at build time,
689 # but can also be manually invoked via the 'validate-accessibility' alias.
690 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run: \
691 $(VBOX_PATH_MANUAL_SRC)/en_US/Accessibility.xml \
692 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
693 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
694 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
695 $(call MSG_L1,Validating $<)
696 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
697 $(QUIET)$(APPEND) -t "$@" "done"
698
699
700 # Handy aliases.
701 validate-accessibility:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run
702 accessibility:: $(PATH_STAGE_BIN)/Accessibility.pdf
703 accessibility-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
704
705
706 # A few things which are shared between htmlhelp and qhelp docs.
707 VBOX_DOCBOOK_HTMLHELP_FORMATCFG = \
708 $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
709 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
710 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
711
712 # Prepare the XSL file for our title page, htmlhelp and qhelp variant.
713 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl: \
714 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
715 $(call MSG_L1,xsltproc $<)
716 $(QUIET)$(RM) -f [email protected] $@
717 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
718 $(QUIET)$(MV) -f [email protected] $@
719
720
721 ifdef VBOX_WITH_DOCS_CHM
722 #
723 # VirtualBox.chm
724 #
725 # We first generate a .hhp help source file from the preprocessed
726 # DocBook XML files, as defined above, then feed that into the
727 # Microsoft Help Compiler.
728
729 # Generate CHM from HHP
730 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
731 define def_vbox_usermanual_hhp_to_chm
732 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
733 $$(out_dir)/VirtualBox.chm: \
734 $$(out_dir)/HTMLHelp/htmlhelp.hhp \
735 $$(addprefix $$(out_dir)/HTMLHelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
736 | $$$$(dir $$$$@)
737 $$(call MSG_L1,hhc $$<,=> $$@)
738 $$(QUIET)$$(RM) -f $$@
739 $$(QUIET)$$(VBOX_HHC) $$(subst /,\\,$$<)
740 $$(call MSG_L1,Fresh CHM is now at $$@)
741 endef
742 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_hhp_to_chm))
743
744 # Generate HHP from XML
745 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
746 define def_vbox_usermanual_xml_to_hhp
747 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
748 $$(out_dir)/HTMLHelp/htmlhelp.hhp: \
749 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
750 $$(VBOX_MANUAL_XML_FILES_COMMON) \
751 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
752 $$(VBOX_DOCBOOK_HTMLHELP_FORMATCFG) \
753 $$(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
754 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
755 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
756 $$(VBOX_XML_ENTITIES) | $$$$(dir $$$$@)
757 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
758 $$(QUIET)$$(RM) -f $$@
759 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$(@D)/ \
760 --stringparam htmlhelp.chm \
761 $$(subst /,\\,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/VirtualBox.chm) \
762 $$(HTMLHELPOPTS) $$(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
763 $$<
764 endef
765 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_hhp))
766
767 # copy the PNG files.
768 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
769 define def_vbox_cp_images_htmlhelp
770 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
771 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
772 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
773 $$(call MSG_L1,Copying temporary $$< => $$@)
774 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
775 endef
776 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_htmlhelp)))
777
778 endif # VBOX_WITH_DOCS_CHM
779
780
781 # Packing the docs into a zip file
782 $(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
783 $(call MSG_L1,Packing documentation $@)
784 $(QUIET)$(RM) -f $@
785 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
786
787
788 ##########################################################################################
789 #
790 # UserManual.html
791 #
792 ##########################################################################################
793 VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG = \
794 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
795 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
796 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
797
798 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
799 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
800 $(VBOX_MANUAL_XML_FILES_COMMON) \
801 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
802 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
803 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
804 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
805 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
806 $(VBOX_XML_ENTITIES) | $$(dir $$@)
807 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
808 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
809 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
810 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
811 $<
812
813 VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG = \
814 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
815 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
816 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
817
818 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
819 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
820 $(VBOX_MANUAL_XML_FILES_COMMON) \
821 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
822 $(VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG) \
823 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
824 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
825 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
826 $(VBOX_XML_ENTITIES) | $$(dir $$@)
827 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
828 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
829 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
830 --stringparam chunk.section.depth 0 \
831 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
832 $<
833
834 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
835 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
836 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
837 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
838 $(call MSG_L1,Packing documentation $@)
839 $(QUIET)$(RM) -f $@
840 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- $(VBOX_ZIP) \
841 -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
842
843 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
844 html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
845 qhelp:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/qhelp/, $(VBOX_QHELP_OUTPUT_FILES))
846 html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
847
848 ##########################################################################################
849 #
850 # DITA stuff common to pdf, qhelp, and html outputs.
851 # - copy DITA-OT library (binaries etc) since at each run several run-time config
852 # files are updated.
853 # - create dita/topic folder and copy all user manual dita files under that.
854 # - copy all images under dita/topics/images and UserManual.ditamap under dita folder
855 # - copy all man_VBox???.xml docbook files under dita/topic folder.
856 # - flatten refsect1/refsect2 hierarchy in man_VBox???.xml docbook files by
857 # using refsect2_to_refsect1.py.
858 # - convert man_VBox???.xml files into dita files
859 # - correct all reference targets by calling correct_references.py.
860 #
861 ##########################################################################################
862
863 ##########################################################################################
864 #
865 # Docbook to Dita conversion of our refentry files
866 #
867 ##########################################################################################
868 define def_vbox_refentry_to_dita
869 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(addsuffix .dita,$(basename $(2))): \
870 $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl \
871 $(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
872 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
873 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
874
875 $$(QUIET)$$(RM) -f "$$@"
876 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/refsect2_to_refsect1.py -i $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) -o $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)
877 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
878 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $$(VBOX_DITA_CONVERTER_PATH)/db2dita/docbook2dita.xsl $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics/$(2)
879 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $(VBOX_PATH_MANUAL_SRC)/mark_external_urls.xsl $$@
880 endef
881 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) man_vboximg-mount.xml\
882, $(evalcall2 def_vbox_refentry_to_dita,$(lang),$(file))))
883
884 refentry-to-dita: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file, $(basename $(VBOX_MANUAL_XML_REFENTRY_FILES)) man_vboximg-mount \
885 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/dita/topics/$(file).dita))
886
887 VBOX_REFENTRY_DITA_FILES = $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file, $(basename $(VBOX_MANUAL_XML_REFENTRY_FILES)) man_vboximg-mount \
888 ,$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/dita/topics/$(file).dita))
889
890 ##########################################################################################
891 #
892 # Use DITA-OT to create pdf/hhp out of UserManual.ditamap. See usermanual.pdf under
893 # DITA-OT-xxxxx/doc folder for details.
894 #
895 ##########################################################################################
896 # Copy the dita library under out folder since at each use the library modifies some
897 # run-time configuation files.
898 $(VBOX_DITA_PATH):
899 $(MKDIR) -p $(VBOX_DITA_PATH)
900 cp -R $(VBOX_DITA_ORIGINAL_PATH)/* $(VBOX_DITA_PATH)/
901
902 VBOX_DITA_PATH_LIB ?= $(VBOX_DITA_PATH)/lib
903 VBOX_DITA_ENV_SETUP ?= $(REDIRECT) \
904 -E 'ANT_OPTS=-Xmx512m -Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl' \
905 -E 'ANT_HOME=$(VBOX_DITA_PATH)/tools/ant' \
906 -E 'DITA_DIR=$(VBOX_DITA_PATH)' \
907 -E 'JAVA_HOME=$(VBOX_JAVA_HOME)' \
908 -A 'PATH=:$(VBOX_DITA_PATH)/tools/ant/bin' \
909 -E 'CLASSPATH=$(VBOX_DITA_PATH_LIB)/dost.jar' \
910 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)' \
911 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/commons-codec-1.4.jar' \
912 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/resolver.jar' \
913 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/icu4j.jar' \
914 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/xercesImpl.jar' \
915 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/xml-apis.jar' \
916 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/saxon/saxon9.jar' \
917 -A 'CLASSPATH=:$(VBOX_DITA_PATH_LIB)/saxon/saxon9-dom.jar' \
918 --
919
920 VBOX_USER_MANUAL_DITA_FILES = $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/*dita)
921 VBOX_USER_MANUAL_DITA_IMAGES = $(wildcard $(VBOX_PATH_MANUAL_SRC)/en_US/dita/topics/images/*)
922
923 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/UserManual.ditamap:
924 $(QUIET)$(MKDIR) -p $(VBOX_PATH_MANUAL_OUTBASE)/en_US/dita/topics/images
925 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_PATH_MANUAL_SRC)/en_US/dita/UserManual.ditamap "$(@D)"
926 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_USER_MANUAL_DITA_FILES) "$(@D)/topics"
927 $(QUIET)touch -- "$(@D)/topics/reference.dtd"
928 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_USER_MANUAL_DITA_IMAGES) "$(@D)/topics/images"
929
930 define def_ditamap_to_pdf
931 ditamap-to-pdf: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf
932 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/UserManual.pdf: \
933 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
934 $$(VBOX_MANUAL_XML_FILES_COMMON) \
935 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
936 $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
937 $(VBOX_DITA_PATH) \
938 $(VBOX_REFENTRY_DITA_FILES) \
939 $$(VBOX_PATH_MANUAL_SRC)/correct_references.py
940 $$(call MSG_L1,correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics)
941 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics
942 $(QUIET)$(call VBOX_DITA_ENV_SETUP) \
943 $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
944 /transtype:pdf /ditadir:$(VBOX_DITA_PATH) /outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1) /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp
945
946 endef
947 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_pdf,$(lang)))
948
949 #
950 # ChangeLog.html
951 #
952 # This XSLT rule formats en_US/user_ChangeLog.xml (which includes the actual change log
953 # contained in user_ChangeLogImpl.xml) as a standalone HTML file.
954 #
955 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
956 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
957 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
958 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
959 $(VBOX_XML_ENTITIES) | $$(dir $$@)
960 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
961 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
962 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
963
964 cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
965
966
967
968endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
969
970
971#
972# VBoxManage man pages (parts also required by VBoxManage built-in help).
973#
974
975##
976# Emits rules for preprocessing refentry sources (applying remarks element),
977# and for producing the actual man pages.
978# $(evalcall2 def_vbox_refentry_to_manpage)
979# @param 1 The language
980# @param 2 The file name (no path).
981define def_vbox_refentry_to_manpage
982 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
983 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
984 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
985 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) \
986 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
987 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
988 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
989 $$(QUIET)$$(RM) -f "$$@"
990 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
991 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
992 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output [email protected] $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$$(VBOX_XML_XREF_TO_TEXT) $$@
993 $$(QUIET)$$(MV) -f -- "[email protected]" "$$@"
994 if defined(VBOX_HAVE_XMLLINT)
995 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
996 endif
997
998 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
999 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
1000 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl \
1001 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
1002 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
1003 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
1004 $$(QUIET)$$(RM) -f "$$@"
1005 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --maxdepth 6000 --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl $$<
1006endef
1007$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
1008, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
1009
1010ifdef VBOX_WITH_DOCS_QHELP
1011 #
1012 # VirtualBox.qch/VirtualBox.qhc
1013 #
1014 # We first generate a .hhp help source file from the preprocessed
1015 # DocBook XML files, as defined above, then feed that into a converter
1016 # creating the suitable input for creating a QHelp collection file.
1017
1018 # Generate QCH from QHelp source
1019 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
1020 define def_vbox_usermanual_qhp_to_qch
1021 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
1022 $$(out_dir)/qhelp/UserManual.qch + \
1023 $$(out_dir)/qhelp/UserManual.qhc: \
1024 $$(out_dir)/qhelp/UserManual.qhcp \
1025 $$(out_dir)/qhelp/UserManual.qhp \
1026 $$(addprefix $$(out_dir)/qhelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
1027 | $$$$(dir $$$$@)
1028 $$(call MSG_L1,$$(notdir $$(QHELPGENERATOR)) $$<,=> $$@)
1029 $$(QUIET)$$(RM) -f $$@
1030 $$(QUIET)$$(REDIRECT) -E QT_QPA_PLATFORM_PLUGIN_PATH=$$(PATH_SDK_QT5)/plugins -- $$(QHELPGENERATOR) $$<
1031 $$(call MSG_L1,Fresh QCH is now at $$@)
1032 endef
1033 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_qhp_to_qch))
1034
1035 # Generate QHP from HHP for QHelp
1036 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
1037 define def_vbox_usermanual_hhp_qhelp_to_qhp
1038 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
1039 $$(out_dir)/qhelp/UserManual.qhp: \
1040 $$(out_dir)/qhelp/UserManual.hhp \
1041 $$(addprefix $$(out_dir)/qhelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
1042 | $$$$(dir $$$$@)
1043 $$(call MSG_L1,htmlhelp-qthelp.py $$<,=> $$@)
1044 $$(QUIET)$$(RM) -f $$@
1045 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/htmlhelp-qthelp.py -d $$(<D) -o $$@ -f UserManual.hhp -t UserManual.hhc
1046 endef
1047 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_hhp_qhelp_to_qhp))
1048
1049
1050 define def_ditamap_to_htmlhelp
1051 ditamap-to-htmlhelp: $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp
1052 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp/UserManual.hhp: \
1053 $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
1054 $(VBOX_DITA_PATH) \
1055 $(VBOX_REFENTRY_DITA_FILES) \
1056 $$(VBOX_PATH_MANUAL_SRC)/correct_references.py
1057 $$(call MSG_L1,correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics)
1058 $$(QUIET)$$(VBOX_BLD_PYTHON) $$(VBOX_PATH_MANUAL_SRC)/correct_references.py -d $(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/topics
1059 $(QUIET)$(call VBOX_DITA_ENV_SETUP) \
1060 $(VBOX_JAVA) -jar $(VBOX_DITA_PATH_LIB)/dost.jar /i:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/UserManual.ditamap \
1061 /transtype:htmlhelp /ditadir:$(VBOX_DITA_PATH) /outdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/qhelp /tempdir:$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/dita/temp
1062
1063 endef
1064 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_ditamap_to_htmlhelp,$(lang)))
1065
1066 # copy the qhcp file.
1067 define def_vbox_cp_qhcp
1068 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/qhelp
1069 $$(out_dir)/UserManual.qhcp: \
1070 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/% | $$$$(dir $$$$@)
1071 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
1072 endef
1073 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_qhcp)))
1074
1075 # copy the PNG files.
1076 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
1077 define def_vbox_cp_images_qhelp
1078 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/qhelp
1079 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
1080 $$(out_dir)/% : $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
1081 $$(call MSG_L1,Copying temporary $$< => $$@)
1082 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
1083 endef
1084 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_qhelp)))
1085
1086endif # VBOX_WITH_DOCS_QHELP
1087
1088# Handy aliases.
1089validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
1090man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
1091 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
1092
1093#
1094# Manually updating the DHCP option list taken from VirtualBox.xidl
1095#
1096dhcpoptions: $(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xsl \
1097 $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
1098 $(call VBOX_XSLTPROC) --output "$(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml" $+
1099
1100
1101include $(FILE_KBUILD_SUB_FOOTER)
1102
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