VirtualBox

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

Last change on this file since 89313 was 89313, checked in by vboxsync, 4 years ago

FE/Qt: bugref:9831. Using qhelpgenerator instead of deprecated qcollectiongenerator

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