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