VirtualBox

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

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

bugref:9831. Adding a missing prerequisite for manual.qhp

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