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