VirtualBox

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

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

doc/manual: bugref:9831. Run qcollectiongenerator from the configured directory, not some random system installed one.

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