VirtualBox

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

Last change on this file since 94239 was 94239, checked in by vboxsync, 3 years ago

FE/VBoxManage: Remove the now unused VBoxManageHelp build target and the VBOX_ONLY_DOCS #ifdef's in the code, ​bugref:9186 [missing changes in doc/manual]

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