VirtualBox

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

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

bugref:9831. Creating qhelp collection files.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.2 KB
Line 
1# $Id: Makefile.kmk 86308 2020-09-28 09:29:24Z 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
362if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
363
364##
365# Morph man pages into manual sections.
366# $(evalcall2 def_vbox_refentry_to_user_sect1)
367# @param 1 Language.
368# @param 2 the refentry xml base file name.
369# @param 3 the full refentry xml file path.
370define def_vbox_refentry_to_user_sect1
371$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): $(3) \
372 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
373 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
374 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
375 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(filter %.xml,$$^),$$@)
376 $$(QUIET)$$(RM) -f "$$@"
377 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
378endef
379$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
380man_VBoxHeadless.xml \
381man_vboximg-mount.xml \
382, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file),$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file))))
383$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
384,$(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),isomakercmd-man.xml,$(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
385
386
387# Generates the VBoxManage command overview include file (shared between
388# languages) from the refsynopsisdiv section of the man pages.
389$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
390 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
391 $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
392 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
393 $(VBOX_XML_ENTITIES) | $$(dir $$@)
394 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
395 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
396
397$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(VBOXMANAGEHELP_PATH) $(MAKEFILE_CURRENT) | $$(dir $$@)
398 $(call MSG_GENERATE,,$@,)
399 $(QUIET)$(RM) -f $@ [email protected]
400 $(QUIET)$(APPEND) -tn "$@" \
401 '<?xml version="1.0" encoding="UTF-8"?>' \
402 '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">' \
403 '<sect1> <!-- this will be skipped via xpointer in the include. --> '
404 $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
405 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
406 -- \
407 $(VBOXMANAGEHELP_PATH) --dumpopts
408 $(QUIET)$(SED) \
409 -e ':a' \
410 -e 'N' \
411 -e '$(DOLLAR)!ba' \
412 -e 's/</\&lt\;/g' \
413 -e 's/>/\&gt\;/g' \
414 -e 's/\n*$(DOLLAR)/<\/screen>/' \
415 -e 's/^/<screen>/' \
416 --append $@ [email protected]
417 $(QUIET)$(RM) -f [email protected]
418 $(QUIET)$(APPEND) -n "$@" \
419 ' <remark role="VBoxManage-overview">' \
420 $(foreach refentry, $(filter man_VBoxManage%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
421 , ' <xi:include href="overview_$(refentry)" xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />') \
422 ' </remark>' \
423 '</sect1>'
424
425
426
427
428##########################################################################################
429#
430# Shared rules for PDF generation
431#
432##########################################################################################
433
434ifndef VBOX_OSE
435# copy ucs.sty and related files
436$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
437 $(call MSG_L1,Copying unicode support for LaTeX)
438 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
439endif
440
441# copy the PNG files.
442# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
443define def_vbox_cp_images_pdf
444local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
445$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
446 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
447 $$(call MSG_L1,Copying temporary $$< => $$@)
448 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
449endef
450$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
451
452
453##########################################################################################
454#
455# UserManual.pdf
456#
457##########################################################################################
458
459
460# Generate PDF from LaTeX
461# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
462define def_vbox_usermanual_tex_to_pdf
463local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
464$$(out_dir)/UserManual.pdf: \
465 $$(out_dir)/UserManual.tex \
466 $$(if $$(VBOX_OSE),,$$(out_dir)/ucs.sty) \
467 $$(addprefix $$(out_dir)/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) | $$$$(dir $$$$@)
468# PDF generation via Latex: generate the .tex file
469 $$(call MSG_L1,pdflatex $$< (four passes) -> $$@)
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)$$(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)$$(SED) -ne '/Warning: Hyper reference/p' $$(basename $$<).log
475 $$(QUIET)$$(SED) -n \
476 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
477 $$(basename $$@).log
478 $$(call MSG_L1,Fresh LaTeX-generated PDF is now at $$@)
479endef
480$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_tex_to_pdf))
481
482# Generate LaTeX from XML
483# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
484define def_vbox_usermanual_xml_to_tex
485local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
486$$(out_dir)/UserManual.tex: \
487 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
488 $$(VBOX_MANUAL_XML_FILES_COMMON) \
489 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
490 $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
491 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
492 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
493 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
494 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(firstword $$(filter %.xml,$$^)),$$@)
495 $$(QUIET)$$(RM) -f $$(addprefix $$(@D)/,$$(VBOX_MANUAL_LATEX_FILES_TARGET))
496# generate TeX source from processed docbook and store it in UserManual.tex.tmp;
497# pass current language to xsltproc in TARGETLANG variable
498 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG $(lang) \
499 -o [email protected] $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $$<
500# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
501# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
502 $$(QUIET)$$(SED) \
503 -e 's|^\\QUOTE{}|\\OQ{}|g' \
504 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
505 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
506 --output $$@ [email protected]
507 $$(QUIET)$$(RM) -f [email protected]
508endef
509$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_tex))
510
511# Useful aliases
512usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
513
514debug-usermanual:
515 $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
516
517#
518# Generate rules for validating the UserManual.xml. These are invoked
519# automatically at build time, but can also be manually invoked via the
520# 'validatemanual' and 'validatemanual_<lang>' aliases.
521#
522define def_vbox_validate_xml
523validatemanual_$(lang):: $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run
524$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run: \
525 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
526 $$(VBOX_MANUAL_XML_FILES_COMMON) \
527 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
528 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
529 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
530 $$(call MSG_L1,Validating $$<)
531 $$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$<
532 $$(QUIET)$$(APPEND) -t "$$@" "done"
533endef
534$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_validate_xml))
535
536
537# Handy aliases.
538validatemanual:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),validatemanual_$(lang))
539
540
541
542#
543# SDKRef.pdf
544#
545
546# Replace <tt> tags in VirtualBox.xidl.
547$(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
548 $(call MSG_L1,Generating $@)
549 $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
550 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
551 --output $@ $<
552
553# Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
554$(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
555 $(call MSG_L1,Generating $@)
556 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
557
558# Turn SDKRef.xml into LaTeX.
559$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
560 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
561 $(VBOX_MANUAL_APIREF_TMP) \
562 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
563 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run,) \
564 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
565 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
566 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
567 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
568# generate TeX source from processed docbook and store it in SDKRef.tex.tmp
569 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
570 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
571# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
572# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
573 $(QUIET)$(SED) \
574 -e 's|^\\QUOTE{}|\\OQ{}|g' \
575 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
576 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
577 --output $@ [email protected]
578 $(QUIET)$(RM) -f [email protected]
579
580# Turn SDKRef.tex into a PDF.
581$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf: \
582 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
583 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
584 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
585 $(call MSG_L1,pdflatex $< (three passes))
586 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
587 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
588 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
589 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
590 $(QUIET)$(SED) -n \
591 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
592 $(basename $<).log
593 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
594
595# Validating SDKRef.xml. It is invoked automatically at build time,
596# but can also be manually invoked via the 'validate-sdkref' alias.
597$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run: \
598 $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml \
599 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
600 $(VBOX_MANUAL_APIREF_TMP) \
601 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
602 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
603 $(call MSG_L1,Validating $<)
604 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
605 $(QUIET)$(APPEND) -t "$@" "done"
606
607
608# Handy aliases.
609validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run
610sdkref:: $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
611
612
613
614#
615# Accessibility.pdf
616#
617
618# Turn Accessibility.xml into LaTeX.
619$(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex: \
620 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
621 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
622 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run,) \
623 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
624 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
625 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
626 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET))
627# generate TeX source from processed docbook and store it in Accessibility.tex.tmp
628 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
629 -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
630# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
631# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
632 $(QUIET)$(SED) \
633 -e 's|^\\QUOTE{}|\\OQ{}|g' \
634 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
635 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
636 --output $@ [email protected]
637 $(QUIET)$(RM) -f [email protected]
638
639# Turn Accessibility.tex into a PDF.
640$(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf: \
641 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex \
642 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
643 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
644 $(call MSG_L1,pdflatex $< (three passes))
645 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
646 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
647 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
648 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
649 $(QUIET)$(SED) -n \
650 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
651 $(basename $<).log
652 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
653
654$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html: \
655 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
656 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
657 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
658 $(VBOX_XML_ENTITIES) | $$(dir $$@)
659 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
660 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
661 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html \
662 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
663 $<
664
665# Validating Accessibility.xml. It is invoked automatically at build time,
666# but can also be manually invoked via the 'validate-accessibility' alias.
667$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run: \
668 $(VBOX_PATH_MANUAL_SRC)/en_US/Accessibility.xml \
669 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
670 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
671 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
672 $(call MSG_L1,Validating $<)
673 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
674 $(QUIET)$(APPEND) -t "$@" "done"
675
676
677# Handy aliases.
678validate-accessibility:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run
679accessibility:: $(PATH_STAGE_BIN)/Accessibility.pdf
680accessibility-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
681
682
683
684ifdef VBOX_WITH_DOCS_CHM
685 #
686 # VirtualBox.chm
687 #
688 # We first generate a .hhp help source file from the preprocessed
689 # DocBook XML files, as defined above, then feed that into the
690 # Microsoft Help Compiler.
691 #
692 VBOX_DOCBOOK_HTMLHELP_FORMATCFG = \
693 $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
694 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
695 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
696
697 # Prepare the XSL file for our title page, htmlhelp variant.
698 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl: \
699 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
700 $(call MSG_L1,xsltproc $<)
701 $(QUIET)$(RM) -f [email protected] $@
702 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
703 $(QUIET)$(MV) -f [email protected] $@
704
705 # Generate CHM from HHP
706 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
707 define def_vbox_usermanual_hhp_to_chm
708 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
709 $$(out_dir)/VirtualBox.chm: \
710 $$(out_dir)/HTMLHelp/htmlhelp.hhp \
711 $$(addprefix $$(out_dir)/HTMLHelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
712 | $$$$(dir $$$$@)
713 $$(call MSG_L1,hhc $$<,=> $$@)
714 $$(QUIET)$$(RM) -f $$@
715 $$(QUIET)$$(VBOX_HHC) $$(subst /,\\,$$<)
716 $$(call MSG_L1,Fresh CHM is now at $$@)
717 endef
718 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_hhp_to_chm))
719
720 # Generate HHP from XML
721 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
722 define def_vbox_usermanual_xml_to_hhp
723 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
724 $$(out_dir)/HTMLHelp/htmlhelp.hhp: \
725 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
726 $$(VBOX_MANUAL_XML_FILES_COMMON) \
727 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
728 $$(VBOX_DOCBOOK_HTMLHELP_FORMATCFG) \
729 $$(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
730 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
731 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
732 $$(VBOX_XML_ENTITIES) | $$$$(dir $$$$@)
733 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
734 $$(QUIET)$$(RM) -f $$@
735 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$(@D)/ \
736 --stringparam htmlhelp.chm \
737 $$(subst /,\\,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/VirtualBox.chm) \
738 $$(HTMLHELPOPTS) $$(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
739 $$<
740 endef
741 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_hhp))
742
743 # copy the PNG files.
744 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
745 define def_vbox_cp_images_htmlhelp
746 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
747 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
748 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
749 $$(call MSG_L1,Copying temporary $$< => $$@)
750 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
751 endef
752 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_htmlhelp)))
753
754endif # VBOX_WITH_DOCS_CHM
755
756
757# Packing the docs into a zip file
758$(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
759 $(call MSG_L1,Packing documentation $@)
760 $(QUIET)$(RM) -f $@
761 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
762
763
764##########################################################################################
765#
766# UserManual.xhtml
767#
768##########################################################################################
769VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG = \
770 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
771 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
772 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
773
774$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml: \
775 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
776 $(VBOX_MANUAL_XML_FILES_COMMON) \
777 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
778 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
779 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
780 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
781 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
782 $(VBOX_XML_ENTITIES) | $$(dir $$@)
783 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
784 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
785 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml \
786 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
787 $<
788
789VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG = \
790 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
791 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
792 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
793
794$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
795 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
796 $(VBOX_MANUAL_XML_FILES_COMMON) \
797 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
798 $(VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG) \
799 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
800 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
801 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
802 $(VBOX_XML_ENTITIES) | $$(dir $$@)
803 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
804 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
805 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
806 --stringparam chunk.section.depth 0 \
807 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
808 $<
809
810$(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
811 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml \
812 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
813 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
814 $(call MSG_L1,Packing documentation $@)
815 $(QUIET)$(RM) -f $@
816 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- $(VBOX_ZIP) \
817 -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
818
819html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml
820html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
821qhelp:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhc
822html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
823
824
825#
826# ChangeLog.html
827#
828# This XSLT rule formats en_US/user_ChangeLog.xml (which includes the actual change log
829# contained in user_ChangeLogImpl.xml) as a standalone HTML file.
830#
831$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
832 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
833 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
834 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
835 $(VBOX_XML_ENTITIES) | $$(dir $$@)
836 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
837 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
838 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
839
840cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
841
842
843
844endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
845
846
847#
848# VBoxManage man pages (parts also required by VBoxManage built-in help).
849#
850
851##
852# Emits rules for preprocessing refentry sources (applying remarks element),
853# and for producing the actual man pages.
854# $(evalcall2 def_vbox_refentry_to_manpage)
855# @param 1 The language
856# @param 2 The file name (no path).
857define def_vbox_refentry_to_manpage
858$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
859 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
860 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
861 $$(VBOX_XML_XREF_TO_TEXT) \
862 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
863 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
864 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
865 $$(QUIET)$$(RM) -f "$$@"
866 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
867 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
868 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output [email protected] $$(VBOX_XML_XREF_TO_TEXT) $$@
869 $$(QUIET)$$(MV) -f -- "[email protected]" "$$@"
870if defined(VBOX_HAVE_XMLLINT)
871 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
872endif
873
874$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
875 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
876 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl \
877 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
878 $$(VBOX_XML_ENTITIES) $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
879 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
880 $$(QUIET)$$(RM) -f "$$@"
881 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl $$<
882endef
883$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
884, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
885
886################Generate qHelp's qhp file out of UserManual.xhtml###############################
887$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhp: \
888 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
889 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
890 $(VBOX_XML_ENTITIES) | $$(dir $$@) \
891 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml
892 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
893 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
894 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhp \
895 $(VBOX_PATH_MANUAL_SRC)/xhtml-qhelp.xsl \
896 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.xhtml
897
898################Copy qhcp file from the source directory###############################
899$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhcp: \
900 $$(dir $$@)
901 $(QUIET)$(INSTALL_STAGING) -m0664 -- $(addprefix $(VBOX_PATH_MANUAL_SRC)/, $(VBOX_QHCP_FILES)) $@
902
903$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhc: \
904 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhcp \
905 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhp \
906 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/, $(VBOX_MANUAL_PNG_FILES_en_US))
907 qcollectiongenerator $<
908
909$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/, images):
910 mkdir -p $@
911
912$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/, $(VBOX_MANUAL_PNG_FILES_en_US)): \
913 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/, $(VBOX_MANUAL_PNG_FILES_en_US)) \
914 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/, images)
915 $(QUIET)$(INSTALL_STAGING) -m0644 -- $< $@
916
917$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qch: \
918 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/manual.qhc
919
920# Handy aliases.
921validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
922man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
923 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
924
925#
926# Manually updating the DHCP option list taken from VirtualBox.xidl
927#
928dhcpoptions: $(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xsl \
929 $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
930 $(call VBOX_XSLTPROC) --output "$(PATH_ROOT)/doc/manual/en_US/man_VBoxManage-dhcpserver-dhcpoptions.xml" $+
931
932
933include $(FILE_KBUILD_SUB_FOOTER)
934
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