1 | # $Id: Makefile.kmk 56498 2015-06-18 11:02:35Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox User Manual.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2015 Oracle Corporation
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | # available from http://www.virtualbox.org. This file is free software;
|
---|
11 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | # General Public License (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | #
|
---|
19 | # This slightly messy makefile transforms the DocBook XML source for the
|
---|
20 | # user manual into presentation output. We support two targets:
|
---|
21 | #
|
---|
22 | # -- UserManual.pdf, generated by LaTex
|
---|
23 | #
|
---|
24 | # -- VirtualBox.chm
|
---|
25 | #
|
---|
26 | # Both files end up in PATH_STAGE_BIN.
|
---|
27 | #
|
---|
28 | # Both targets indirectly depend on the XML files in this directory;
|
---|
29 | # "indirectly" because we first copy them to PATH_TARGET and hack them
|
---|
30 | # up a bit for variable substitution and such (see below).
|
---|
31 | # The toolchains are roughly like this:
|
---|
32 | #
|
---|
33 | # -- PDF file via Apache FOP: pre-process the XML files in PATH_TARGET,
|
---|
34 | # then create a .FO file (another XML format for "formatted objects")
|
---|
35 | # via xsltproc, then feed the .FO file to Apache FOP to create the PDF.
|
---|
36 | #
|
---|
37 | # -- PDF file via LaTeX: pre-process the XML files in PATH_TARGET, then
|
---|
38 | # run our custom "dblatex" perl script on UserManual.xml, which parses
|
---|
39 | # the XML (using the Perl SAX parsers) and dumps a matching latex file
|
---|
40 | # to UserManual.tex. This is then regularly processed by pdflatex to
|
---|
41 | # generate PDF.
|
---|
42 | #
|
---|
43 | # -- CHM file: again, pre-process the XML files in PATH_TARGET, then use
|
---|
44 | # xsltproc to create a .HHP file for the Microsoft Help Compiler, then
|
---|
45 | # feed that file to it.
|
---|
46 | #
|
---|
47 |
|
---|
48 | SUB_DEPTH = ../..
|
---|
49 | include $(KBUILD_PATH)/subheader.kmk
|
---|
50 |
|
---|
51 |
|
---|
52 | #
|
---|
53 | # Globals
|
---|
54 | #
|
---|
55 |
|
---|
56 | # Error out if someone tries to override old globals.
|
---|
57 | ifdef HTMLHELPOPTS
|
---|
58 | $(error HTMLHELPOPTS was renamed to VBOX_HTMLHELP_OPTS!)
|
---|
59 | endif
|
---|
60 | ifdef DOCBOOKPATH
|
---|
61 | $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
|
---|
62 | endif
|
---|
63 | ifdef DOCBOOKPATH
|
---|
64 | $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
|
---|
65 | endif
|
---|
66 | ifdef XML_CATALOG
|
---|
67 | $(error XML_CATALOG was renamed to VBOX_XML_CATALOG!)
|
---|
68 | endif
|
---|
69 | ifdef VBOX_XML_CATALOG_DOCBOOK
|
---|
70 | $(error XML_CATALOG_DOCBOOK was renamed to VBOX_XML_CATALOG_DOCBOOK!)
|
---|
71 | endif
|
---|
72 | ifdef VBOXMANAGEPATH
|
---|
73 | $(error VBOXMANAGEPATH was renamed to VBOXMANAGEHELP_PATH!)
|
---|
74 | endif
|
---|
75 | ifdef PDFLATEX_INTERACTION
|
---|
76 | $(error PDFLATEX_INTERACTION was renamed to VBOX_PDFLATEX_INTERACTION!)
|
---|
77 | endif
|
---|
78 | ifdef PDFLATEX
|
---|
79 | $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
|
---|
80 | endif
|
---|
81 | ifdef HHC
|
---|
82 | $(error HHC was renamed to VBOX_HHC!)
|
---|
83 | endif
|
---|
84 |
|
---|
85 | # Source and output locations.
|
---|
86 | VBOX_PATH_MANUAL_SRC := $(PATH_SUB_CURRENT)
|
---|
87 | VBOX_PATH_MANUAL_OUTBASE := $(PATH_TARGET)/manual
|
---|
88 |
|
---|
89 | # tool locations
|
---|
90 | ifndef VBOX_OSE
|
---|
91 | # use docbook from our tools directory
|
---|
92 | VBOX_PATH_DOCBOOK ?= $(PATH_DEVTOOLS)/common/DocBook/v1.69.1
|
---|
93 | VBOX_PATH_DOCBOOK_DTD ?= $(PATH_DEVTOOLS)/common/docbook-xml/v4.3
|
---|
94 | VBOX_XML_CATALOG ?= $(VBOX_PATH_MANUAL_OUTBASE)/catalog
|
---|
95 | VBOX_XML_CATALOG_DOCBOOK ?= $(VBOX_PATH_MANUAL_OUTBASE)/docbook
|
---|
96 | else
|
---|
97 | # use docbook of the build host
|
---|
98 | VBOX_PATH_DOCBOOK ?= http://docbook.sourceforge.net/release/xsl/current/
|
---|
99 | endif
|
---|
100 |
|
---|
101 | # xsltproc with the catalog trick if applicable.
|
---|
102 | ifdef VBOX_XML_CATALOG
|
---|
103 | VBOX_XSLTPROC_WITH_CAT = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- $(VBOX_XSLTPROC)
|
---|
104 | else
|
---|
105 | VBOX_XSLTPROC_WITH_CAT = $(VBOX_XSLTPROC)
|
---|
106 | endif
|
---|
107 |
|
---|
108 | VBOXMANAGEHELP_PATH ?= $(PATH_STAGE_BIN)/VBoxManageHelp$(SUFF_EXE)
|
---|
109 |
|
---|
110 | # VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
|
---|
111 | # without catting the log a million times.
|
---|
112 | VBOX_PDFLATEX_INTERACTION ?= batchmode
|
---|
113 | ifeq ($(KBUILD_HOST),win)
|
---|
114 | ifndef VBOX_PDFLATEX
|
---|
115 | VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
|
---|
116 | ifneq ($(VBOX_PDFLATEX),)
|
---|
117 | VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
|
---|
118 | endif
|
---|
119 | endif
|
---|
120 | ifndef VBOX_PDFLATEX
|
---|
121 | # Tell MiKTeX to automatically download packages if system wide install.
|
---|
122 | VBOX_PDFLATEX := pdflatex
|
---|
123 | VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
|
---|
124 | endif
|
---|
125 | else
|
---|
126 | VBOX_PDFLATEX ?= pdflatex
|
---|
127 | VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
|
---|
128 | VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
|
---|
129 | endif
|
---|
130 |
|
---|
131 | # Windows HTML Help Workshop compiler (stupid thing always returns an error!)
|
---|
132 | VBOX_HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
|
---|
133 |
|
---|
134 |
|
---|
135 | # Additional xsltproc options when generating
|
---|
136 | VBOX_HTMLHELP_OPTS ?=
|
---|
137 |
|
---|
138 | # SDK related globals.
|
---|
139 | VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
|
---|
140 | VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
|
---|
141 | VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
|
---|
142 |
|
---|
143 | ##
|
---|
144 | # Non-pattern-rule approach to editing XSLT files.
|
---|
145 | # $(evalcall2 def_vbox_replace_paths_in_xslt)
|
---|
146 | # @param 1 The XSLT source file (relative to Makefile dir).
|
---|
147 | # @param 2 Optional output subdirectory.
|
---|
148 | define def_vbox_replace_paths_in_xslt
|
---|
149 | OTHER_CLEAN += $$(VBOX_PATH_MANUAL_OUTBASE)/$2$(notdir $1)
|
---|
150 | $$(VBOX_PATH_MANUAL_OUTBASE)/$2$(notdir $1): $$(VBOX_PATH_MANUAL_SRC)/$1 | $$$$(dir $$$$@)
|
---|
151 | $$(call MSG_GENERATE,,$$@,$$<)
|
---|
152 | $$(QUIET)$$(SED) \
|
---|
153 | -e 's|@VBOX_PATH_DOCBOOK@|$$(VBOX_PATH_DOCBOOK)|g' \
|
---|
154 | -e 's|@VBOX_PATH_MANUAL_SRC@|$$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
155 | -e 's|@VBOX_PATH_MANUAL_OUTBASE@|$$(VBOX_PATH_MANUAL_OUTBASE)|g' \
|
---|
156 | \
|
---|
157 | -e 's|@CFGPATH@|$$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
158 | -e 's|@TARGETPATH@|$$(@D)|g' \
|
---|
159 | --output "$$(@)" $$<
|
---|
160 | endef
|
---|
161 |
|
---|
162 |
|
---|
163 | ## List of refentry files (manpages).
|
---|
164 | VBOX_MANUAL_XML_REFENTRY_FILES = \
|
---|
165 | man_VBoxManage_debugvm.xml \
|
---|
166 | man_VBoxManage_extpack.xml
|
---|
167 |
|
---|
168 |
|
---|
169 | #
|
---|
170 | # Targets
|
---|
171 | #
|
---|
172 |
|
---|
173 | BLDDIRS += $(VBOX_PATH_MANUAL_OUTBASE)
|
---|
174 |
|
---|
175 | if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
|
---|
176 | if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
|
---|
177 | ## @todo make this an install target, drop the BLDDIRS.
|
---|
178 | OTHERS += \
|
---|
179 | $(VBOX_PATH_SDK)/docs/SDKRef.pdf
|
---|
180 | BLDDIRS += \
|
---|
181 | $(VBOX_PATH_SDK)/docs
|
---|
182 | endif
|
---|
183 |
|
---|
184 | ifdef VBOX_WITH_DOCS_CHM
|
---|
185 | VBOX_PATH_BIN_CHM = $(PATH_STAGE_BIN)/VirtualBox.chm
|
---|
186 | else # Do not build chm.
|
---|
187 | VBOX_PATH_BIN_CHM =
|
---|
188 | endif
|
---|
189 |
|
---|
190 | ifndef VBOX_ONLY_SDK
|
---|
191 | VBOX_MANUAL_PACK += \
|
---|
192 | $(PATH_STAGE_BIN)/UserManual.pdf \
|
---|
193 | $(VBOX_PATH_BIN_CHM)
|
---|
194 | OTHERS += \
|
---|
195 | $(PATH_STAGE_BIN)/UserManual.pdf
|
---|
196 | OTHERS.win += \
|
---|
197 | $(VBOX_PATH_BIN_CHM)
|
---|
198 | OTHERS.linux += \
|
---|
199 | $(VBOX_PATH_BIN_CHM)
|
---|
200 |
|
---|
201 | ifdef VBOX_WITH_DOCS_TRANSLATIONS
|
---|
202 | OTHERS += \
|
---|
203 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
|
---|
204 | ifdef VBOX_WITH_DOCS_CHM
|
---|
205 | OTHERS.win += \
|
---|
206 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
|
---|
207 | OTHERS.linux += \
|
---|
208 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
|
---|
209 | endif
|
---|
210 | endif
|
---|
211 | endif # !VBOX_ONLY_SDK
|
---|
212 | ifdef VBOX_ONLY_DOCS
|
---|
213 | PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
|
---|
214 | endif
|
---|
215 |
|
---|
216 | ifdef VBOX_WITH_DOCS_TRANSLATIONS
|
---|
217 | VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
|
---|
218 | endif
|
---|
219 |
|
---|
220 | VBOX_MANUAL_XML_CHANGELOG = \
|
---|
221 | user_ChangeLogImpl.xml
|
---|
222 |
|
---|
223 | VBOX_MANUAL_XML_FILES = \
|
---|
224 | UserManual.xml \
|
---|
225 | user_AdvancedTopics.xml \
|
---|
226 | user_BasicConcepts.xml \
|
---|
227 | user_Glossary.xml \
|
---|
228 | user_Frontends.xml \
|
---|
229 | user_Installation.xml \
|
---|
230 | user_GuestAdditions.xml \
|
---|
231 | user_Introduction.xml \
|
---|
232 | user_KnownIssues.xml \
|
---|
233 | user_PrivacyPolicy.xml \
|
---|
234 | user_Security.xml \
|
---|
235 | user_Technical.xml \
|
---|
236 | user_ThirdParty.xml \
|
---|
237 | user_Troubleshooting.xml \
|
---|
238 | user_VBoxManage.xml \
|
---|
239 | user_VirtualBoxAPI.xml \
|
---|
240 | user_Storage.xml \
|
---|
241 | user_Networking.xml
|
---|
242 |
|
---|
243 | VBOX_MANUAL_XML_FILES_INCL_CHANGELOG = $(VBOX_MANUAL_XML_FILES) \
|
---|
244 | user_ChangeLog.xml
|
---|
245 |
|
---|
246 | VBOX_SDKREF_XML_FILES = \
|
---|
247 | SDKRef.xml
|
---|
248 |
|
---|
249 | # Wildcard the images path for every supported language
|
---|
250 | $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
|
---|
251 | $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
|
---|
252 |
|
---|
253 | VBOX_MANUAL_TEX_UNICODE_FILES = \
|
---|
254 | $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
|
---|
255 |
|
---|
256 | VBOX_MANUAL_LATEX_FILES_TARGET = \
|
---|
257 | $(addprefix UserManual.,aux log out toc tex)
|
---|
258 |
|
---|
259 | VBOX_SDKREF_LATEX_FILES_TARGET = \
|
---|
260 | $(addprefix SDKRef.,aux log out toc tex)
|
---|
261 |
|
---|
262 | BLDDIRS += \
|
---|
263 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/,\
|
---|
264 | $(VBOX_MANUAL_LANGUAGES) \
|
---|
265 | $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
266 | $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
267 | $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
268 | $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
269 | $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
270 | )
|
---|
271 |
|
---|
272 | ifdef VBOX_WITH_DOCS_CHM
|
---|
273 | VBOX_MANUAL_PACK += \
|
---|
274 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf $(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
|
---|
275 | endif
|
---|
276 |
|
---|
277 | OTHER_CLEAN += \
|
---|
278 | $(VBOX_XML_CATALOG) \
|
---|
279 | $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
280 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
|
---|
281 | $(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG) \
|
---|
282 | $(VBOX_MANUAL_XML_REFENTRY_FILES) \
|
---|
283 | $(VBOX_MANUAL_LATEX_FILES_TARGET) \
|
---|
284 | $(VBOX_MANUAL_PNG_FILES_$(lang)) \
|
---|
285 | $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
|
---|
286 | $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
|
---|
287 | html-single/UserManual.html \
|
---|
288 | $(addprefix html-chunks/ HTMLHelp/, index.html go01.html) \
|
---|
289 | $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
|
---|
290 | ,html-chunks/ch$(n).html \
|
---|
291 | HTMLHelp/ch$(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,HTMLHelp/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 | HTMLHelp/toc.hhc \
|
---|
298 | HTMLHelp/htmlhelp.hhp \
|
---|
299 | docbook-htmlhelp-formatcfg.xsl \
|
---|
300 | docbook-html-one-page-formatcfg.xsl \
|
---|
301 | docbook-html-chunks-formatcfg.xsl \
|
---|
302 | titlepage-htmlhelp.xsl \
|
---|
303 | UserManual.pdf \
|
---|
304 | VirtualBox.chm \
|
---|
305 | )) \
|
---|
306 | $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG) \
|
---|
307 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
|
---|
308 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
|
---|
309 | $(PATH_STAGE_BIN)/UserManual.pdf \
|
---|
310 | $(PATH_STAGE_BIN)/VirtualBox.chm \
|
---|
311 | \
|
---|
312 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
|
---|
313 | $(VBOX_SDKREF_XML_FILES) \
|
---|
314 | $(VBOX_SDKREF_LATEX_FILES_TARGET) \
|
---|
315 | SDKRef.pdf \
|
---|
316 | ) \
|
---|
317 | $(VBOX_DOC_XIDL_SRC_TMP) \
|
---|
318 | $(VBOX_MANUAL_APIREF_TMP) \
|
---|
319 | $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
|
---|
320 |
|
---|
321 | endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
|
---|
322 |
|
---|
323 |
|
---|
324 |
|
---|
325 | #
|
---|
326 | # To avoid network I/O for fetching DTDs, we generate catalogs mapping the public
|
---|
327 | # entity IDs to local files. (Obviously, only done when we have local files.)
|
---|
328 | #
|
---|
329 | ifdef VBOX_XML_CATALOG
|
---|
330 | # Create a catalog file for xsltproc that points to docbook catalog.
|
---|
331 | $(VBOX_XML_CATALOG): $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
332 | $(call MSG_L1,Creating catalog $@)
|
---|
333 | $(QUIET)$(RM) -f [email protected] $@
|
---|
334 | $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
|
---|
335 | $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
|
---|
336 | $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
|
---|
337 | $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/ENTITIES DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
|
---|
338 | $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/DTD DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
|
---|
339 | $(QUIET)$(APPEND) [email protected] ' <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
|
---|
340 | $(QUIET)$(APPEND) [email protected] ' <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>'
|
---|
341 | $(QUIET)$(APPEND) [email protected] '</catalog>'
|
---|
342 | $(QUIET)$(MV) -f [email protected] $@
|
---|
343 |
|
---|
344 | # Create a docbook catalog file for xsltproc that points to the local docbook files.
|
---|
345 | $(VBOX_XML_CATALOG_DOCBOOK): $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
346 | $(call MSG_L1,Creating catalog $@)
|
---|
347 | $(QUIET)$(RM) -f [email protected] $@
|
---|
348 | $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
|
---|
349 | $(QUIET)$(APPEND) [email protected] '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">'
|
---|
350 | $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
|
---|
351 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbpoolx.mod"/>'
|
---|
352 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
|
---|
353 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.4//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>'
|
---|
354 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Character Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbcentx.mod"/>'
|
---|
355 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Notations V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbnotnx.mod"/>'
|
---|
356 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Additional General Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbgenent.mod"/>'
|
---|
357 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbhierx.mod"/>'
|
---|
358 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/soextblx.dtd"/>'
|
---|
359 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML CALS Table Model V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/calstblx.dtd"/>'
|
---|
360 | $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
|
---|
361 | $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
|
---|
362 | $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
|
---|
363 | $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>'
|
---|
364 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsa.ent"/>'
|
---|
365 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsb.ent"/>'
|
---|
366 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsc.ent"/>'
|
---|
367 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsn.ent"/>'
|
---|
368 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amso.ent"/>'
|
---|
369 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsr.ent"/>'
|
---|
370 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-box.ent"/>'
|
---|
371 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr1.ent"/>'
|
---|
372 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr2.ent"/>'
|
---|
373 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-dia.ent"/>'
|
---|
374 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk1.ent"/>'
|
---|
375 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk2.ent"/>'
|
---|
376 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk3.ent"/>'
|
---|
377 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk4.ent"/>'
|
---|
378 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat1.ent"/>'
|
---|
379 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat2.ent"/>'
|
---|
380 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-num.ent"/>'
|
---|
381 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Publishing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-pub.ent"/>'
|
---|
382 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES General Technical//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-tech.ent"/>'
|
---|
383 | $(QUIET)$(APPEND) [email protected] '</catalog>'
|
---|
384 | $(QUIET)$(MV) -f [email protected] $@
|
---|
385 | endif
|
---|
386 |
|
---|
387 |
|
---|
388 | if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
|
---|
389 |
|
---|
390 |
|
---|
391 | ##########################################################################################
|
---|
392 | #
|
---|
393 | # Rules: Preprocess DocBook XML files
|
---|
394 | # (preliminary step for both CHM and PDF generation)
|
---|
395 | #
|
---|
396 | ##########################################################################################
|
---|
397 |
|
---|
398 | #
|
---|
399 | # The following rules for $(VBOX_PATH_MANUAL_OUTBASE)/*.xml process the XML files
|
---|
400 | # in doc/manual to allow for some magic variable replacements. The PDF and CHM
|
---|
401 | # targets do not depend on the XML files in doc/manual, but those in
|
---|
402 | # $(VBOX_PATH_MANUAL_OUTBASE) instead, which we copy there from here, after that magic
|
---|
403 | # processing.
|
---|
404 | #
|
---|
405 | # So, before copying, the following steps are performed:
|
---|
406 | #
|
---|
407 | # -- $VBOX_VERSION_* strings are replaced with the actual current VBox version.
|
---|
408 | # -- $VBOX_MANAGE_OUTPUT (in VBoxManage.xml) is replaced with the current
|
---|
409 | # output of the actual VBoxManage program, to save us from having to
|
---|
410 | # update the manual all the time.
|
---|
411 | #
|
---|
412 |
|
---|
413 | # Only one changelog for all languages
|
---|
414 | # $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG): $(VBOX_PATH_MANUAL_SRC)/$(VBOX_MANUAL_XML_CHANGELOG) | $$(dir $$@)
|
---|
415 | # $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
416 |
|
---|
417 | # intermediate step to do some variable replacement in the document
|
---|
418 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(filter-out user_VBoxManage.xml,$(VBOX_MANUAL_XML_FILES)))): \
|
---|
419 | $(VBOX_PATH_MANUAL_OUTBASE)/% : $(VBOX_PATH_MANUAL_SRC)/% $(VBOX_VERSION_STAMP) | $$(dir $$@)
|
---|
420 | $(call MSG_L1,Pre-processing [1] $(@F) to $@)
|
---|
421 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
422 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
423 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
424 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
425 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
426 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
427 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
428 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
429 | --output [email protected] $<
|
---|
430 | $(QUIET)$(MV) -f [email protected] $@
|
---|
431 |
|
---|
432 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_ChangeLog.xml): \
|
---|
433 | $(VBOX_PATH_MANUAL_OUTBASE)/% : \
|
---|
434 | $(VBOX_PATH_MANUAL_SRC)/% $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml | $$(dir $$@)
|
---|
435 | $(call MSG_L1,Pre-processing [3] $(@F) to $@)
|
---|
436 | $(QUIET)$(RM) -f $@ [email protected] [email protected]
|
---|
437 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
438 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
439 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
440 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
441 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
442 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
443 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
444 | --output [email protected] $<
|
---|
445 | $(QUIET)$(SED) -e '1,/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->/!d' \
|
---|
446 | -e 's/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->//' \
|
---|
447 | --output $@ [email protected]
|
---|
448 | var=`$(SED) -n '/!--\$$VIRTUALBOX_CHANGELOG_IMPL-->/p' $<`; \
|
---|
449 | test -n "$${var}" \
|
---|
450 | && $(SED) -e 's/<?xml version=\"1.0\" encoding=\"UTF-8\"?>//g' \
|
---|
451 | --append $@ $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml; \
|
---|
452 | true
|
---|
453 | $(QUIET)$(SED) -e '/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->/,$$!d' \
|
---|
454 | -e 's/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->//' --append $@ [email protected]
|
---|
455 | $(QUIET)$(RM) -f -- "[email protected]"
|
---|
456 |
|
---|
457 | # TODO: figure why the rule below doesn't cause kmk to rebuild the manual when a man page changes!
|
---|
458 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
|
---|
459 | $(eval $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/user_VBoxManage.xml: $(VBOX_PATH_MANUAL_SRC)/$(lang)/user_VBoxManage.xml \
|
---|
460 | $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
461 | $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
462 | $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml ))
|
---|
463 |
|
---|
464 | # user_VBoxManage.xml currently needs some extra processing to stitch in the VBoxManage usage blob.
|
---|
465 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_VBoxManage.xml): \
|
---|
466 | $(VBOX_PATH_MANUAL_OUTBASE)/% : \
|
---|
467 | $(VBOX_PATH_MANUAL_SRC)/% \
|
---|
468 | $$(addprefix $$(@D)/,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
469 | $$(addprefix $$(@D)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
470 | $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
|
---|
471 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
472 | $(VBOXMANAGEHELP_PATH) | $$(dir $$@)
|
---|
473 | $(call MSG_L1,Pre-processing [2] $(@F) to $@)
|
---|
474 | $(QUIET)$(RM) -f $@ [email protected] [email protected]
|
---|
475 | $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
|
---|
476 | $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
|
---|
477 | -- \
|
---|
478 | $(VBOXMANAGEHELP_PATH) --dumpopts
|
---|
479 | $(QUIET)$(SED) \
|
---|
480 | -e ':a' \
|
---|
481 | -e 'N' \
|
---|
482 | -e '$(DOLLAR)!ba' \
|
---|
483 | -e 's/</\<\;/g' \
|
---|
484 | -e 's/>/\>\;/g' \
|
---|
485 | -e 's/\n*$(DOLLAR)/<\/screen>/' \
|
---|
486 | -e 's/^/<screen>/' \
|
---|
487 | --output [email protected] [email protected]
|
---|
488 | $(QUIET)$(SED) \
|
---|
489 | -e '/@VBOX_MANAGE_OUTPUT@/{' -e 'r [email protected]' -e 'd' -e '}' \
|
---|
490 | \
|
---|
491 | -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
492 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
493 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
494 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
495 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
496 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
497 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
498 | -e 's|@VBOX_PATH_DOCBOOK@|$(VBOX_PATH_DOCBOOK)|g' \
|
---|
499 | -e 's|@VBOX_PATH_MANUAL_SRC@|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
500 | --output "$@" \
|
---|
501 | "$<"
|
---|
502 | $(QUIET)$(RM) -f [email protected] [email protected]
|
---|
503 |
|
---|
504 |
|
---|
505 | # Morph man pages into manual sections.
|
---|
506 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$(VBOX_MANUAL_XML_REFENTRY_FILES))): \
|
---|
507 | $(VBOX_PATH_MANUAL_OUTBASE)/% : $(VBOX_PATH_MANUAL_SRC)/% \
|
---|
508 | $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
|
---|
509 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
510 | $(VBOX_VERSION_STAMP) | $$(dir $$@)
|
---|
511 | $(call MSG_GENERATE,,$@,$<)
|
---|
512 | $(QUIET)$(RM) -f $@
|
---|
513 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output $@ \
|
---|
514 | $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $<
|
---|
515 |
|
---|
516 |
|
---|
517 | $(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
518 | $(call MSG_L1,Generating $@)
|
---|
519 | $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
|
---|
520 | -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
|
---|
521 | --output $@ $<
|
---|
522 |
|
---|
523 | # Generates the VBoxManage command overview include file (shared between
|
---|
524 | # languages) from the refsynopsisdiv section of the man pages.
|
---|
525 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
|
---|
526 | $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
|
---|
527 | $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
|
---|
528 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
529 | | $$(dir $$@)
|
---|
530 | $(call MSG_GENERATE,,$@,$(filter %.xml,$^))
|
---|
531 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output "$@" $< $(filter %.xml,$^)
|
---|
532 |
|
---|
533 | $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
534 | $(call MSG_GENERATE,,$@,)
|
---|
535 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
536 | '<?xml version="1.0" encoding="UTF-8"?>' \
|
---|
537 | '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">' \
|
---|
538 | '<remark role="VBoxManage-overview">' \
|
---|
539 | $(foreach refentry, $(filter man_VBoxManage%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
540 | , ' <xi:include href="overview_$(refentry)" xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />') \
|
---|
541 | '</remark>'
|
---|
542 |
|
---|
543 |
|
---|
544 |
|
---|
545 | # generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
|
---|
546 | $(VBOX_MANUAL_APIREF_TMP): $(VBOX_DOC_XIDL_SRC_TMP) $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl
|
---|
547 | $(call MSG_L1,Generating $@)
|
---|
548 | $(QUIET)$(VBOX_XSLTPROC) --xinclude -o $@ $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
|
---|
549 |
|
---|
550 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.xml: \
|
---|
551 | $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml $(VBOX_MANUAL_APIREF_TMP) \
|
---|
552 | | $$(dir $$@)
|
---|
553 | $(call MSG_L1,Pre-processing [2] $(@F) to $@)
|
---|
554 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
555 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
556 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
557 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
558 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
559 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
560 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
561 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
562 | --output [email protected] $<
|
---|
563 | $(QUIET)$(SED) -e '1,/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->/!d' \
|
---|
564 | -e 's/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->//' \
|
---|
565 | --output $@ [email protected]
|
---|
566 | $(QUIET)$(SED) -e 's/<?xml version=\"1.0\" encoding=\"utf-8\"?>//g' --append $@ $(VBOX_MANUAL_APIREF_TMP)
|
---|
567 | $(QUIET)$(SED) -e '/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->/,$$!d' \
|
---|
568 | -e 's/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->//' --append $@ [email protected]
|
---|
569 | # $(QUIET)$(MV) -f [email protected] $@
|
---|
570 | $(QUIET)$(RM) -f -- "[email protected]"
|
---|
571 |
|
---|
572 |
|
---|
573 | ##########################################################################################
|
---|
574 | #
|
---|
575 | # Shared rules for PDF generation
|
---|
576 | #
|
---|
577 | ##########################################################################################
|
---|
578 |
|
---|
579 | ifndef VBOX_OSE
|
---|
580 | # copy ucs.sty and related files
|
---|
581 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
|
---|
582 | $(call MSG_L1,Copying unicode support for LaTeX)
|
---|
583 | $(QUIET)$(INSTALL_STAGING) -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
|
---|
584 | endif
|
---|
585 |
|
---|
586 | # copy the PNG files.
|
---|
587 | # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
|
---|
588 | define def_vbox_cp_images_pdf
|
---|
589 | local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
|
---|
590 | $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
|
---|
591 | $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
|
---|
592 | $$(call MSG_L1,Copying temporary $$< => $$@)
|
---|
593 | $$(QUIET)$$(INSTALL_STAGING) -- '$$<' '$$(@D)'
|
---|
594 | endef
|
---|
595 |
|
---|
596 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_pdf)))
|
---|
597 |
|
---|
598 |
|
---|
599 | ##########################################################################################
|
---|
600 | #
|
---|
601 | # UserManual.pdf
|
---|
602 | #
|
---|
603 | ##########################################################################################
|
---|
604 |
|
---|
605 | ## @todo INSTALLS target for this!
|
---|
606 | $(PATH_STAGE_BIN)/UserManual.pdf: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf | $$(dir $$@)
|
---|
607 | $(QUIET)$(CP) $< $@
|
---|
608 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
609 |
|
---|
610 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf): \
|
---|
611 | $(PATH_STAGE_BIN)/UserManual_%.pdf : $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf
|
---|
612 | $(QUIET)$(CP) $< $@
|
---|
613 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
614 |
|
---|
615 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.pdf): \
|
---|
616 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf : \
|
---|
617 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex \
|
---|
618 | $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/%/ucs.sty) \
|
---|
619 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),\
|
---|
620 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_PNG_FILES_$(f)))) | $$(dir $$@)
|
---|
621 | # PDF generation via Latex: generate the .tex file
|
---|
622 | $(call MSG_L1,pdflatex $< (four passes) -> $@)
|
---|
623 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
|
---|
624 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
|
---|
625 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
|
---|
626 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(VBOX_PDFLATEX_CMD) UserManual.tex
|
---|
627 | $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
|
---|
628 | $(QUIET)$(SED) -n \
|
---|
629 | -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
|
---|
630 | $(basename $@).log
|
---|
631 |
|
---|
632 | ##@todo restore this when above has been converted to INSTALLS target. $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
633 |
|
---|
634 | # generate temporary LaTeX source from processed XML
|
---|
635 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.tex): \
|
---|
636 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex : \
|
---|
637 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
638 | $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
|
---|
639 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT)
|
---|
640 | $(call MSG_L1,Generating $@ from DocBook XML)
|
---|
641 | $(QUIET)$(RM) -f $(addprefix $(@D)/,$(VBOX_MANUAL_LATEX_FILES_TARGET))
|
---|
642 | # generate TeX source from processed docbook and store it in UserManual.tex.tmp;
|
---|
643 | # pass current language to xsltproc in TARGETLANG variable (extract it from the
|
---|
644 | # current directory, should become "de_DE" or the like)
|
---|
645 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG $(notdir $(@D)) \
|
---|
646 | -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
|
---|
647 | # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
|
---|
648 | # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
|
---|
649 | $(QUIET)$(SED) \
|
---|
650 | -e 's|^\\QUOTE{}|\\OQ{}|g' \
|
---|
651 | -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
|
---|
652 | -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
|
---|
653 | --output $@ [email protected]
|
---|
654 | $(QUIET)$(RM) -f [email protected]
|
---|
655 |
|
---|
656 | # Useful aliases
|
---|
657 | usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
|
---|
658 |
|
---|
659 | debug-usermanual:
|
---|
660 | $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
|
---|
661 |
|
---|
662 | # validate each processed set of XML files
|
---|
663 | define def_vbox_validate_xml
|
---|
664 | validatemanual_$(lang): \
|
---|
665 | $$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
666 | $$(MAKEFILE_CURRENT)
|
---|
667 | $$(QUIET)xmllint --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd --xinclude --noout $$<
|
---|
668 | endef
|
---|
669 |
|
---|
670 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_validate_xml)))
|
---|
671 |
|
---|
672 | # validate all translations of the manual
|
---|
673 | validatemanual: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),validatemanual_$(lang))
|
---|
674 |
|
---|
675 |
|
---|
676 | #
|
---|
677 | # SDKRef.pdf
|
---|
678 | #
|
---|
679 | $(VBOX_PATH_SDK)/docs/SDKRef.pdf: \
|
---|
680 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
|
---|
681 | $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
|
---|
682 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
|
---|
683 | # PDF generation via Latex: generate the .tex file
|
---|
684 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/docs
|
---|
685 | $(call MSG_L1,pdflatex $< (three passes))
|
---|
686 | $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
|
---|
687 | $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
|
---|
688 | $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
|
---|
689 | $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
|
---|
690 | $(QUIET)$(SED) -n \
|
---|
691 | -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
|
---|
692 | $(basename $<).log
|
---|
693 | $(QUIET)$(CP) $(<D)/SDKRef.pdf $@
|
---|
694 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
695 |
|
---|
696 | # generate temporary LaTeX source from processed XML
|
---|
697 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
|
---|
698 | $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
|
---|
699 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE_CURRENT)
|
---|
700 | $(call MSG_L1,Generating $@ from DocBook XML)
|
---|
701 | $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
|
---|
702 | # generate TeX source from processed docbook and store it in SDKRef.tex.tmp
|
---|
703 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG en_US \
|
---|
704 | -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
|
---|
705 | # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
|
---|
706 | # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
|
---|
707 | $(QUIET)$(SED) \
|
---|
708 | -e 's|^\\QUOTE{}|\\OQ{}|g' \
|
---|
709 | -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
|
---|
710 | -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
|
---|
711 | --output $@ [email protected]
|
---|
712 | $(QUIET)$(RM) -f [email protected]
|
---|
713 |
|
---|
714 |
|
---|
715 | # validate SDK manual
|
---|
716 | validatesdkref: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
|
---|
717 | $(MAKEFILE_CURRENT)
|
---|
718 | $(QUIET)xmllint --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd --xinclude --noout $<
|
---|
719 |
|
---|
720 |
|
---|
721 |
|
---|
722 | ifdef VBOX_WITH_DOCS_CHM
|
---|
723 | #
|
---|
724 | # VirtualBox.chm
|
---|
725 | #
|
---|
726 | # We first generate a .hhp help source file from the preprocessed
|
---|
727 | # DocBook XML files, as defined above, then feed that into the
|
---|
728 | # Microsoft Help Compiler.
|
---|
729 | #
|
---|
730 | $(PATH_STAGE_BIN)/VirtualBox.chm: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.chm
|
---|
731 | $(QUIET)$(CP) $< $@
|
---|
732 | $(call MSG_L1,Fresh CHM is now at $@)
|
---|
733 |
|
---|
734 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm): \
|
---|
735 | $(PATH_STAGE_BIN)/VirtualBox_%.chm : $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm
|
---|
736 | $(QUIET)$(CP) $< $@
|
---|
737 | $(call MSG_L1,Fresh CHM is now at $@)
|
---|
738 |
|
---|
739 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/VirtualBox.chm): \
|
---|
740 | $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm: \
|
---|
741 | $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp \
|
---|
742 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(f))))
|
---|
743 | $(call MSG_L1,hhc $<,=> $@)
|
---|
744 | $(QUIET)$(RM) -f $@
|
---|
745 | $(QUIET)$(VBOX_HHC) $(subst /,\\,$<)
|
---|
746 |
|
---|
747 |
|
---|
748 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
749 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/docbook-htmlhelp-formatcfg.xsl): \
|
---|
750 | $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
751 | $(call MSG_GENERATE,,$@,$<)
|
---|
752 | $(QUIET)$(RM) -f $@
|
---|
753 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(VBOX_PATH_DOCBOOK)|g' \
|
---|
754 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
755 | -e 's|\$$TARGETPATH|$(@D)|g' --output $@ $<
|
---|
756 |
|
---|
757 | # Manual formatcfg dependencies.
|
---|
758 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES), $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/docbook-htmlhelp-formatcfg.xsl): \
|
---|
759 | $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
|
---|
760 | $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
|
---|
761 |
|
---|
762 | # Prepare the XSL file for our title page, htmlhelp variant.
|
---|
763 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/titlepage-htmlhelp.xsl): \
|
---|
764 | $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
765 | $(call MSG_L1,xsltproc $<)
|
---|
766 | $(QUIET)$(RM) -f [email protected] $@
|
---|
767 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
|
---|
768 | $(QUIET)$(MV) -f [email protected] $@
|
---|
769 |
|
---|
770 |
|
---|
771 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/htmlhelp.hhp): \
|
---|
772 | $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp: \
|
---|
773 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
774 | $(VBOX_PATH_MANUAL_OUTBASE)/%/docbook-htmlhelp-formatcfg.xsl \
|
---|
775 | $(VBOX_PATH_MANUAL_OUTBASE)/%/titlepage-htmlhelp.xsl \
|
---|
776 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK)
|
---|
777 | $(call MSG_L1,xsltproc $<,=> $@)
|
---|
778 | $(QUIET)$(RM) -f $@
|
---|
779 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
780 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output $(@D)/ \
|
---|
781 | --stringparam htmlhelp.chm \
|
---|
782 | $(subst /,\\,$(@D)/../VirtualBox.chm) \
|
---|
783 | $(HTMLHELPOPTS) $(@D)/../docbook-htmlhelp-formatcfg.xsl \
|
---|
784 | $<
|
---|
785 |
|
---|
786 | # copy the PNG files.
|
---|
787 | # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
|
---|
788 | define def_vbox_cp_images_html
|
---|
789 | local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
|
---|
790 | $$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
|
---|
791 | $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
|
---|
792 | $$(call MSG_L1,Copying temporary $$< => $$@)
|
---|
793 | $$(QUIET)$$(CP) -f $$< $$@
|
---|
794 | endef
|
---|
795 |
|
---|
796 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_html)))
|
---|
797 |
|
---|
798 | # Packing the docs into a zip file
|
---|
799 | $(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
|
---|
800 | $(call MSG_L1,Packing documentation $@)
|
---|
801 | $(QUIET)$(RM) -f $@
|
---|
802 | $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- zip$(HOSTSUFF_EXE) -9 $@ $(notdir $^)
|
---|
803 |
|
---|
804 | endif # VBOX_WITH_DOCS_CHM
|
---|
805 |
|
---|
806 |
|
---|
807 | ##########################################################################################
|
---|
808 | #
|
---|
809 | # UserManual.html
|
---|
810 | #
|
---|
811 | ##########################################################################################
|
---|
812 |
|
---|
813 | # Manual formatcfg dependencies.
|
---|
814 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
|
---|
815 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl: \
|
---|
816 | $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
|
---|
817 | $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
|
---|
818 |
|
---|
819 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
820 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl: \
|
---|
821 | $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
822 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
823 | $(QUIET)$(RM) -f [email protected] $@
|
---|
824 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(VBOX_PATH_DOCBOOK)|g' \
|
---|
825 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
826 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
827 | $(QUIET)$(MV) -f [email protected] $@
|
---|
828 |
|
---|
829 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl: \
|
---|
830 | $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
831 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
832 | $(QUIET)$(RM) -f [email protected] $@
|
---|
833 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(VBOX_PATH_DOCBOOK)|g' \
|
---|
834 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
835 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
836 | $(QUIET)$(MV) -f [email protected] $@
|
---|
837 |
|
---|
838 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
|
---|
839 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
|
---|
840 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml \
|
---|
841 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
842 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
|
---|
843 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
844 | | $$(dir $$@)
|
---|
845 | $(call MSG_L1,xsltproc $<)
|
---|
846 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $(XSLTPROC_VERBOSE) \
|
---|
847 | --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
|
---|
848 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
|
---|
849 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
|
---|
850 |
|
---|
851 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
|
---|
852 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
|
---|
853 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml \
|
---|
854 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
855 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
|
---|
856 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) \
|
---|
857 | | $$(dir $$@)
|
---|
858 | $(call MSG_L1,xsltproc $<)
|
---|
859 | $(QUIET)$(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $(XSLTPROC_VERBOSE) \
|
---|
860 | --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
|
---|
861 | --stringparam chunk.section.depth 0 \
|
---|
862 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
|
---|
863 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
|
---|
864 |
|
---|
865 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
|
---|
866 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
|
---|
867 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
|
---|
868 | $(call MSG_L1,Packing documentation $@)
|
---|
869 | $(QUIET)$(RM) -f $@
|
---|
870 | $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- zip$(HOSTSUFF_EXE) \
|
---|
871 | -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
|
---|
872 |
|
---|
873 | html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
|
---|
874 |
|
---|
875 | html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
|
---|
876 |
|
---|
877 | html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
|
---|
878 |
|
---|
879 |
|
---|
880 | ##########################################################################################
|
---|
881 | #
|
---|
882 | # ChangeLog.html
|
---|
883 | #
|
---|
884 | ##########################################################################################
|
---|
885 |
|
---|
886 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
887 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-changelog-formatcfg.xsl: \
|
---|
888 | $(VBOX_PATH_MANUAL_SRC)/docbook-changelog-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
889 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
890 | $(QUIET)$(RM) -f [email protected] $@
|
---|
891 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(VBOX_PATH_DOCBOOK)|g' \
|
---|
892 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
893 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
894 | $(QUIET)$(MV) -f [email protected] $@
|
---|
895 |
|
---|
896 | # This XSLT rule depends on $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml, which is build by the complex rule
|
---|
897 | # $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_ChangeLog.xml): ...
|
---|
898 | # much further above. That rule takes en_US/user_ChangeLog.xml and replaces $VIRTUALBOX_CHANGELOG_IMPL
|
---|
899 | # with the actual change log contained in user_ChangeLogImpl.xml
|
---|
900 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
|
---|
901 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-changelog-formatcfg.xsl \
|
---|
902 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml
|
---|
903 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html \
|
---|
904 | $(@D)/docbook-changelog-formatcfg.xsl \
|
---|
905 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml
|
---|
906 | $(call MSG_L1,Fresh ChangeLog.html is now at $@)
|
---|
907 |
|
---|
908 | cl-html: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
|
---|
909 |
|
---|
910 |
|
---|
911 |
|
---|
912 | endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
|
---|
913 |
|
---|
914 |
|
---|
915 | #
|
---|
916 | # VBoxManage man pages.
|
---|
917 | #
|
---|
918 | $(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-man.xsl,)
|
---|
919 |
|
---|
920 | man-experiment: \
|
---|
921 | $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage_extpack.xml \
|
---|
922 | $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-man.xsl \
|
---|
923 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK)
|
---|
924 | $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet --output z:/tmp/vboxmanage-extpack.1 \
|
---|
925 | $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-man.xsl \
|
---|
926 | $(VBOX_PATH_MANUAL_SRC)/en_US/man_VBoxManage_extpack.xml
|
---|
927 |
|
---|
928 | $(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
|
---|
929 | $(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
|
---|
930 |
|
---|
931 | # validate man page XML source
|
---|
932 | validateman: $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
|
---|
933 | $(MAKEFILE_CURRENT)
|
---|
934 | $(QUIET)xmllint --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd --noout $<
|
---|
935 |
|
---|
936 |
|
---|
937 | #
|
---|
938 | # VBoxManage built-in help.
|
---|
939 | #
|
---|
940 | # Note! Generating the stuff here is a bit annoying, but currently the most
|
---|
941 | # practical way I can come up with.
|
---|
942 | #
|
---|
943 | OTHERS += \
|
---|
944 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
|
---|
945 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
|
---|
946 | OTHER_CLEAN += \
|
---|
947 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
|
---|
948 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
|
---|
949 | help-experiment: \
|
---|
950 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp \
|
---|
951 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h
|
---|
952 |
|
---|
953 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.cpp: \
|
---|
954 | $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl \
|
---|
955 | $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
956 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE)
|
---|
957 | $(call MSG_GENERATE,,$@,$<)
|
---|
958 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
959 | '/* Autogenerated by $<, do not edit! */' \
|
---|
960 | '' \
|
---|
961 | '#include <iprt/types.h>' \
|
---|
962 | '#include "VBoxManageBuiltInHelp.h"' \
|
---|
963 | ''
|
---|
964 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
965 | ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet $< $(refentry))
|
---|
966 | $(QUIET)$(APPEND) -n "$@" \
|
---|
967 | '' \
|
---|
968 | 'PCREFENTRY g_apHelpEntries[] = ' \
|
---|
969 | '{' \
|
---|
970 | $(foreach refentry,$(filter %.xml,$^), ' &g_$(tolower $(patsubst man_%,%,$(notdir $(basename $(refentry))))), ') \
|
---|
971 | '};' \
|
---|
972 | 'const uint32_t g_cHelpEntries = RT_ELEMENTS(g_apHelpEntries);' \
|
---|
973 | ''
|
---|
974 |
|
---|
975 | $(VBOX_PATH_MANUAL_OUTBASE)/VBoxManageBuiltInHelp.h: \
|
---|
976 | $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-H-help.xsl \
|
---|
977 | $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(filter man_VBoxManage_%,$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
|
---|
978 | $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE)
|
---|
979 | $(call MSG_GENERATE,,$@,$<)
|
---|
980 | $(QUIET)$(APPEND) -tn "$@" \
|
---|
981 | '/* Autogenerated by $<, do not edit! */' \
|
---|
982 | '' \
|
---|
983 | '#ifndef ___VBoxManageBuiltInHelp_h___' \
|
---|
984 | '#define ___VBoxManageBuiltInHelp_h___' \
|
---|
985 | '' \
|
---|
986 | '#include <VBox/refentry.h>' \
|
---|
987 | '' \
|
---|
988 | 'RT_C_DECLS_BEGIN' \
|
---|
989 | '' \
|
---|
990 | 'typedef enum HELP_CMD_VBOXMANAGE' \
|
---|
991 | '{' \
|
---|
992 | ' HELP_CMD_VBOXMANAGE_INVALID = 0,'
|
---|
993 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
994 | ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet \
|
---|
995 | --stringparam 'g_sMode' 'cmd' $< $(refentry))
|
---|
996 | $(QUIET)$(APPEND) -n "$@" \
|
---|
997 | ' HELP_CMD_VBOXMANAGE_END' \
|
---|
998 | '} HELP_CMD_VBOXMANAGE;'
|
---|
999 | $(foreach refentry,$(filter %.xml,$^) \
|
---|
1000 | ,$(NLTAB)$(QUIET)$(REDIRECT) -a+to "$@" -- $(VBOX_XSLTPROC_WITH_CAT) --xinclude --nonet \
|
---|
1001 | --stringparam 'g_sMode' 'subcmd' $< $(refentry))
|
---|
1002 | $(QUIET)$(APPEND) -n "$@" \
|
---|
1003 | '' \
|
---|
1004 | 'extern PCREFENTRY g_apHelpEntries[];' \
|
---|
1005 | 'extern const uint32_t g_cHelpEntries;' \
|
---|
1006 | '' \
|
---|
1007 | 'RT_C_DECLS_END' \
|
---|
1008 | '' \
|
---|
1009 | '#endif' \
|
---|
1010 | ''
|
---|
1011 |
|
---|
1012 |
|
---|
1013 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
1014 |
|
---|