VirtualBox

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

Last change on this file since 86287 was 86287, checked in by vboxsync, 5 years ago

bugref:9831. scm fix

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

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette