1 | # $Id: Makefile.kmk 34807 2010-12-07 17:12:58Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Sub-Makefile for the VBox User Manual.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2007 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_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 | #
|
---|
54 | # Globals
|
---|
55 | #
|
---|
56 | ##########################################################################################
|
---|
57 | VBOX_PATH_MANUAL_SRC := $(PATH_SUB_CURRENT)
|
---|
58 | VBOX_PATH_MANUAL_OUTBASE := $(PATH_TARGET)/manual
|
---|
59 | BLDDIRS += $(VBOX_PATH_MANUAL_OUTBASE)
|
---|
60 |
|
---|
61 |
|
---|
62 | ##########################################################################################
|
---|
63 | #
|
---|
64 | # Main targets
|
---|
65 | #
|
---|
66 | ##########################################################################################
|
---|
67 | ifdef VBOX_WITH_DOCS
|
---|
68 | # Default language
|
---|
69 | VBOX_MANUAL_LANGUAGES = en_US
|
---|
70 |
|
---|
71 | ifdef VBOX_WITH_DOCS_TRANSLATIONS
|
---|
72 | VBOX_MANUAL_ADD_LANGUAGES = fr_FR
|
---|
73 | endif
|
---|
74 |
|
---|
75 | if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
|
---|
76 | ## @todo make this an install target, drop the BLDDIRS.
|
---|
77 | OTHERS += \
|
---|
78 | $(VBOX_PATH_SDK)/docs/SDKRef.pdf
|
---|
79 | BLDDIRS += \
|
---|
80 | $(VBOX_PATH_SDK)/docs
|
---|
81 | endif
|
---|
82 |
|
---|
83 | ifdef VBOX_WITH_DOCS_CHM
|
---|
84 | VBOX_PATH_BIN_CHM = $(PATH_BIN)/VirtualBox.chm
|
---|
85 | else
|
---|
86 | VBOX_PATH_BIN_CHM =
|
---|
87 | # do not build
|
---|
88 | endif # !VBOX_WITH_DOCS_CHM
|
---|
89 |
|
---|
90 | ifndef VBOX_ONLY_SDK
|
---|
91 | VBOX_MANUAL_PACK += \
|
---|
92 | $(PATH_BIN)/UserManual.pdf \
|
---|
93 | $(VBOX_PATH_BIN_CHM)
|
---|
94 | OTHERS += \
|
---|
95 | $(PATH_BIN)/UserManual.pdf
|
---|
96 | OTHERS.win += \
|
---|
97 | $(VBOX_PATH_BIN_CHM)
|
---|
98 | OTHERS.linux += \
|
---|
99 | $(VBOX_PATH_BIN_CHM)
|
---|
100 |
|
---|
101 | ifdef VBOX_WITH_DOCS_TRANSLATIONS
|
---|
102 | OTHERS += \
|
---|
103 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/UserManual_$(f).pdf)
|
---|
104 | ifdef VBOX_WITH_DOCS_CHM
|
---|
105 | OTHERS.win += \
|
---|
106 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/VirtualBox_$(f).chm)
|
---|
107 | OTHERS.linux += \
|
---|
108 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/VirtualBox_$(f).chm)
|
---|
109 | endif
|
---|
110 | endif
|
---|
111 | endif # !VBOX_ONLY_SDK
|
---|
112 | ifdef VBOX_ONLY_DOCS
|
---|
113 | PACKING += $(PATH_BIN)/VBoxDocumentation.zip
|
---|
114 | endif
|
---|
115 |
|
---|
116 | ifdef VBOX_WITH_DOCS_TRANSLATIONS
|
---|
117 | VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
|
---|
118 | endif
|
---|
119 |
|
---|
120 | VBOX_MANUAL_XML_CHANGELOG = \
|
---|
121 | user_ChangeLogImpl.xml
|
---|
122 |
|
---|
123 | VBOX_MANUAL_XML_FILES = \
|
---|
124 | UserManual.xml \
|
---|
125 | user_AdvancedTopics.xml \
|
---|
126 | user_BasicConcepts.xml \
|
---|
127 | user_Glossary.xml \
|
---|
128 | user_Frontends.xml \
|
---|
129 | user_Installation.xml \
|
---|
130 | user_GuestAdditions.xml \
|
---|
131 | user_Introduction.xml \
|
---|
132 | user_KnownIssues.xml \
|
---|
133 | user_PrivacyPolicy.xml \
|
---|
134 | user_Technical.xml \
|
---|
135 | user_ThirdParty.xml \
|
---|
136 | user_Troubleshooting.xml \
|
---|
137 | user_VBoxManage.xml \
|
---|
138 | user_VirtualBoxAPI.xml \
|
---|
139 | user_Storage.xml \
|
---|
140 | user_Networking.xml
|
---|
141 |
|
---|
142 | VBOX_MANUAL_XML_FILES_INCL_CHANGELOG = $(VBOX_MANUAL_XML_FILES) \
|
---|
143 | user_ChangeLog.xml
|
---|
144 |
|
---|
145 | VBOX_SDKREF_XML_FILES = \
|
---|
146 | SDKRef.xml
|
---|
147 |
|
---|
148 | # Wildcard the images path for every supported language
|
---|
149 | $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
|
---|
150 | $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
|
---|
151 |
|
---|
152 | VBOX_MANUAL_TEX_UNICODE_FILES = \
|
---|
153 | $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
|
---|
154 |
|
---|
155 | VBOX_MANUAL_LATEX_FILES_TARGET = \
|
---|
156 | $(addprefix UserManual.,aux log out toc tex)
|
---|
157 |
|
---|
158 | VBOX_SDKREF_LATEX_FILES_TARGET = \
|
---|
159 | $(addprefix SDKRef.,aux log out toc tex)
|
---|
160 |
|
---|
161 | BLDDIRS += \
|
---|
162 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/,\
|
---|
163 | $(VBOX_MANUAL_LANGUAGES) \
|
---|
164 | $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
165 | $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
166 | $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
167 | $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
168 | $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
|
---|
169 | )
|
---|
170 |
|
---|
171 | ifdef VBOX_WITH_DOCS_CHM
|
---|
172 | VBOX_MANUAL_PACK += \
|
---|
173 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/UserManual_$(f).pdf $(PATH_BIN)/VirtualBox_$(f).chm)
|
---|
174 | endif
|
---|
175 |
|
---|
176 | OTHER_CLEAN += \
|
---|
177 | $(foreach f,$(VBOX_MANUAL_LANGUAGES), $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG))) \
|
---|
178 | $(foreach f,en_US, $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_SDKREF_XML_FILES))) \
|
---|
179 | $(foreach f,$(VBOX_MANUAL_LANGUAGES), $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_LATEX_FILES_TARGET))) \
|
---|
180 | $(foreach f,en_US, $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_SDKREF_LATEX_FILES_TARGET))) \
|
---|
181 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, \
|
---|
182 | catalog docbook \
|
---|
183 | UserManual.fo) \
|
---|
184 | $(foreach f,$(VBOX_MANUAL_LANGUAGES), $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/, \
|
---|
185 | docbook-htmlhelp-formatcfg.xsl \
|
---|
186 | docbook-html-one-page-formatcfg.xsl \
|
---|
187 | docbook-html-chunks-formatcfg.xsl \
|
---|
188 | titlepage-htmlhelp.xsl )) \
|
---|
189 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_PNG_FILES_$(f)))) \
|
---|
190 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(f)))) \
|
---|
191 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.pdf) \
|
---|
192 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/VirtualBox.chm) \
|
---|
193 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/UserManual_$(f).pdf) \
|
---|
194 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/VirtualBox_$(f).chm) \
|
---|
195 | $(PATH_BIN)/UserManual.pdf \
|
---|
196 | $(PATH_BIN)/VirtualBox.chm \
|
---|
197 | $(foreach f,en_US,$(VBOX_PATH_MANUAL_OUTBASE)/$f/SDKRef.pdf) \
|
---|
198 | $(PATH_BIN)/sdk/docs/SDKRef.pdf \
|
---|
199 | $(wildcard $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/*.h*)) \
|
---|
200 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),\
|
---|
201 | $(patsubst $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/%,$(VBOX_PATH_MANUAL_OUTBASE)/$f/%, \
|
---|
202 | $(VBOX_MANUAL_TEX_UNICODE_FILES))) \
|
---|
203 | $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG)
|
---|
204 |
|
---|
205 | endif # VBOX_WITH_DOCS
|
---|
206 |
|
---|
207 |
|
---|
208 |
|
---|
209 | ##########################################################################################
|
---|
210 | #
|
---|
211 | # Options
|
---|
212 | #
|
---|
213 | ##########################################################################################
|
---|
214 |
|
---|
215 | HTMLHELPOPTS =
|
---|
216 |
|
---|
217 |
|
---|
218 | ##########################################################################################
|
---|
219 | #
|
---|
220 | # Preparations
|
---|
221 | #
|
---|
222 | ##########################################################################################
|
---|
223 |
|
---|
224 | # tool locations
|
---|
225 | ifndef VBOX_OSE
|
---|
226 | # use docbook from our tools directory
|
---|
227 | DOCBOOKPATH ?= $(PATH_DEVTOOLS)/common/DocBook/v1.69.1
|
---|
228 | DOCBOOKDTDPATH ?= $(PATH_DEVTOOLS)/common/docbook-xml/v4.3
|
---|
229 | XML_CATALOG ?= $(VBOX_PATH_MANUAL_OUTBASE)/catalog
|
---|
230 | XML_CATALOG_DOCBOOK ?= $(VBOX_PATH_MANUAL_OUTBASE)/docbook
|
---|
231 | else
|
---|
232 | # use docbook of the build host
|
---|
233 | DOCBOOKPATH ?= http://docbook.sourceforge.net/release/xsl/current/
|
---|
234 | endif
|
---|
235 | VBOXMANAGEPATH ?= $(PATH_BIN)/VBoxManage$(SUFF_EXE)
|
---|
236 |
|
---|
237 | # PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
|
---|
238 | # without catting the log a million times.
|
---|
239 | PDFLATEX_INTERACTION ?= batchmode
|
---|
240 | ifeq ($(KBUILD_HOST),win)
|
---|
241 | # tell MiKTeX to automatically download packages
|
---|
242 | PDFLATEX = pdflatex -halt-on-error -interaction $(PDFLATEX_INTERACTION) --enable-installer
|
---|
243 | else
|
---|
244 | PDFLATEX_HALT = $(shell \
|
---|
245 | ( pdflatex -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
|
---|
246 | PDFLATEX = pdflatex $(PDFLATEX_HALT) -interaction $(PDFLATEX_INTERACTION)
|
---|
247 | endif
|
---|
248 |
|
---|
249 | # Windows HTML Help Workshop compiler (stupid thing always returns an error!)
|
---|
250 | HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
|
---|
251 |
|
---|
252 |
|
---|
253 | ##########################################################################################
|
---|
254 | #
|
---|
255 | # Rules: Preprocess DocBook XML files
|
---|
256 | # (preliminary step for both CHM and PDF generation)
|
---|
257 | #
|
---|
258 | ##########################################################################################
|
---|
259 |
|
---|
260 | #
|
---|
261 | # The following rules for $(VBOX_PATH_MANUAL_OUTBASE)/*.xml process the XML files
|
---|
262 | # in doc/manual to allow for some magic variable replacements. The PDF and CHM
|
---|
263 | # targets do not depend on the XML files in doc/manual, but those in
|
---|
264 | # $(VBOX_PATH_MANUAL_OUTBASE) instead, which we copy there from here, after that magic
|
---|
265 | # processing.
|
---|
266 | #
|
---|
267 | # So, before copying, the following steps are performed:
|
---|
268 | #
|
---|
269 | # -- $VBOX_VERSION_* strings are replaced with the actual current VBox version.
|
---|
270 | # -- $VBOX_MANAGE_OUTPUT (in VBoxManage.xml) is replaced with the current
|
---|
271 | # output of the actual VBoxManage program, to save us from having to
|
---|
272 | # update the manual all the time.
|
---|
273 | #
|
---|
274 |
|
---|
275 | # Only one changelog for all languages
|
---|
276 | # $(VBOX_PATH_MANUAL_OUTBASE)/$(VBOX_MANUAL_XML_CHANGELOG): $(VBOX_PATH_MANUAL_SRC)/$(VBOX_MANUAL_XML_CHANGELOG) | $$(dir $$@)
|
---|
277 | # $(QUIET)$(INSTALL) -m 0644 $< $@
|
---|
278 |
|
---|
279 | # intermediate step to do some variable replacement in the document
|
---|
280 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(filter-out user_VBoxManage.xml,$(VBOX_MANUAL_XML_FILES)))): \
|
---|
281 | $(VBOX_PATH_MANUAL_OUTBASE)/% : $(VBOX_PATH_MANUAL_SRC)/% $(VBOX_VERSION_STAMP) | $$(dir $$@)
|
---|
282 | $(call MSG_L1,Pre-processing [1] $(@F) to $@)
|
---|
283 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
284 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
285 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
286 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
287 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
288 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
289 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
290 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
291 | --output [email protected] $<
|
---|
292 | $(QUIET)$(MV) -f [email protected] $@
|
---|
293 |
|
---|
294 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_ChangeLog.xml): \
|
---|
295 | $(VBOX_PATH_MANUAL_OUTBASE)/% : \
|
---|
296 | $(VBOX_PATH_MANUAL_SRC)/% $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml | $$(dir $$@)
|
---|
297 | $(call MSG_L1,Pre-processing [3] $(@F) to $@)
|
---|
298 | $(QUIET)$(RM) -f $@ [email protected] [email protected]
|
---|
299 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
300 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
301 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
302 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
303 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
304 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
305 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
306 | --output [email protected] $<
|
---|
307 | $(QUIET)$(SED) -e '1,/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->/!d' \
|
---|
308 | -e 's/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->//' \
|
---|
309 | --output $@ [email protected]
|
---|
310 | $(QUIET)$(SED) -e 's/<?xml version=\"1.0\" encoding=\"UTF-8\"?>//g' --append $@ $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml
|
---|
311 | $(QUIET)$(SED) -e '/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->/,$$!d' \
|
---|
312 | -e 's/<!--\$$VIRTUALBOX_CHANGELOG_IMPL-->//' --append $@ [email protected]
|
---|
313 |
|
---|
314 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/user_VBoxManage.xml): \
|
---|
315 | $(VBOX_PATH_MANUAL_OUTBASE)/% : \
|
---|
316 | $(VBOX_PATH_MANUAL_SRC)/% \
|
---|
317 | $(VBOXMANAGEPATH) | $$(dir $$@)
|
---|
318 | $(call MSG_L1,Pre-processing [2] $(@F) to $@)
|
---|
319 | $(QUIET)$(RM) -f $@ [email protected] [email protected]
|
---|
320 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
321 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
322 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
323 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
324 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
325 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
326 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
327 | --output [email protected] $<
|
---|
328 | $(QUIET)$(SED) -e '1,/\$$VBOX_MANAGE_OUTPUT/!d' \
|
---|
329 | -e 's/\$$VBOX_MANAGE_OUTPUT.*//' \
|
---|
330 | --output $@ [email protected]
|
---|
331 | $(QUIET)$(REDIRECT) -wo [email protected] -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
|
---|
332 | $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
|
---|
333 | -- \
|
---|
334 | $(VBOXMANAGEPATH) --dumpopts
|
---|
335 | $(QUIET)$(SED) -e 's/</\</g' -e 's/>/\>/g' --append $@ [email protected]
|
---|
336 | $(QUIET)$(SED) -e '/\$$VBOX_MANAGE_OUTPUT/,$$!d' \
|
---|
337 | -e 's/.*\$$VBOX_MANAGE_OUTPUT//' --append $@ [email protected]
|
---|
338 | $(QUIET)$(RM) -f [email protected] [email protected]
|
---|
339 |
|
---|
340 | VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
|
---|
341 | VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
|
---|
342 | VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
|
---|
343 |
|
---|
344 | $(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
345 | $(call MSG_L1,Generating $@)
|
---|
346 | $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
|
---|
347 | -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
|
---|
348 | --output $@ $<
|
---|
349 |
|
---|
350 | # generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
|
---|
351 | $(VBOX_MANUAL_APIREF_TMP): $(VBOX_DOC_XIDL_SRC_TMP) $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl
|
---|
352 | $(call MSG_L1,Generating $@)
|
---|
353 | $(QUIET)$(VBOX_XSLTPROC) --xinclude -o $@ $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
|
---|
354 |
|
---|
355 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.xml: \
|
---|
356 | $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml $(VBOX_MANUAL_APIREF_TMP) \
|
---|
357 | | $$(dir $$@)
|
---|
358 | $(call MSG_L1,Pre-processing [2] $(@F) to $@)
|
---|
359 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
360 | $(QUIET)$(SED) -e 's/\$$VBOX_VERSION_MAJOR/$(VBOX_VERSION_MAJOR)/g' \
|
---|
361 | -e 's/\$$VBOX_VERSION_MINOR/$(VBOX_VERSION_MINOR)/g' \
|
---|
362 | -e 's/\$$VBOX_VERSION_BUILD/$(VBOX_VERSION_BUILD)/g' \
|
---|
363 | -e 's/\$$VBOX_VERSION_STRING/$(VBOX_VERSION_STRING)/g' \
|
---|
364 | -e 's/\$$VBOX_VENDOR/$(VBOX_VENDOR)/g' \
|
---|
365 | -e 's/\$$VBOX_PRODUCT/$(VBOX_PRODUCT)/g' \
|
---|
366 | -e 's/\$$VBOX_C_YEAR/$(VBOX_C_YEAR)/g' \
|
---|
367 | --output [email protected] $<
|
---|
368 | $(QUIET)$(SED) -e '1,/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->/!d' \
|
---|
369 | -e 's/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->//' \
|
---|
370 | --output $@ [email protected]
|
---|
371 | $(QUIET)$(SED) -e 's/<?xml version=\"1.0\" encoding=\"utf-8\"?>//g' --append $@ $(VBOX_MANUAL_APIREF_TMP)
|
---|
372 | $(QUIET)$(SED) -e '/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->/,$$!d' \
|
---|
373 | -e 's/<!--\$$VIRTUALBOX_MAIN_API_REFERENCE-->//' --append $@ [email protected]
|
---|
374 | # $(QUIET)$(MV) -f [email protected] $@
|
---|
375 |
|
---|
376 |
|
---|
377 | ##########################################################################################
|
---|
378 | #
|
---|
379 | # Rules: Create or preprocess files for xsltproc
|
---|
380 | # (preliminary step for both CHM and PDF generation)
|
---|
381 | #
|
---|
382 | ##########################################################################################
|
---|
383 |
|
---|
384 | # Create a catalog file for xsltproc that points to docbook catalog.
|
---|
385 | ifneq ($(XML_CATALOG),)
|
---|
386 | $(XML_CATALOG): $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
387 | $(call MSG_L1,Creating catalog $@)
|
---|
388 | $(QUIET)$(RM) -f [email protected] $@
|
---|
389 | $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
|
---|
390 | $(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">'
|
---|
391 | $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
|
---|
392 | $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/ENTITIES DocBook XML" catalog="file:///$(XML_CATALOG_DOCBOOK)"/>'
|
---|
393 | $(QUIET)$(APPEND) [email protected] ' <delegatePublic publicIdStartString="-//OASIS/DTD DocBook XML" catalog="file:///$(XML_CATALOG_DOCBOOK)"/>'
|
---|
394 | $(QUIET)$(APPEND) [email protected] ' <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(XML_CATALOG_DOCBOOK)"/>'
|
---|
395 | $(QUIET)$(APPEND) [email protected] ' <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(XML_CATALOG_DOCBOOK)"/>'
|
---|
396 | $(QUIET)$(APPEND) [email protected] '</catalog>'
|
---|
397 | $(QUIET)$(MV) -f [email protected] $@
|
---|
398 |
|
---|
399 | # Create a docbook catalog file for xsltproc that points to the local docbook files.
|
---|
400 | $(XML_CATALOG_DOCBOOK): $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
401 | $(call MSG_L1,Creating catalog $@)
|
---|
402 | $(QUIET)$(RM) -f [email protected] $@
|
---|
403 | $(QUIET)$(APPEND) [email protected] '<?xml version="1.0"?>'
|
---|
404 | $(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">'
|
---|
405 | $(QUIET)$(APPEND) [email protected] '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">'
|
---|
406 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/dbpoolx.mod"/>'
|
---|
407 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/docbookx.dtd"/>'
|
---|
408 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML V4.4//EN" uri="file:///$(DOCBOOKDTDPATH)/docbookx.dtd"/>'
|
---|
409 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Character Entities V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/dbcentx.mod"/>'
|
---|
410 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Notations V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/dbnotnx.mod"/>'
|
---|
411 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ENTITIES DocBook XML Additional General Entities V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/dbgenent.mod"/>'
|
---|
412 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/dbhierx.mod"/>'
|
---|
413 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN" uri="file:///$(DOCBOOKDTDPATH)/soextblx.dtd"/>'
|
---|
414 | $(QUIET)$(APPEND) [email protected] ' <public publicId="-//OASIS//DTD DocBook XML CALS Table Model V4.3//EN" uri="file:///$(DOCBOOKDTDPATH)/calstblx.dtd"/>'
|
---|
415 | $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(DOCBOOKDTDPATH)"/>'
|
---|
416 | $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(DOCBOOKDTDPATH)"/>'
|
---|
417 | $(QUIET)$(APPEND) [email protected] ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(DOCBOOKDTDPATH)"/>'
|
---|
418 | $(QUIET)$(APPEND) [email protected] ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.4" rewritePrefix="file:///$(DOCBOOKDTDPATH)"/>'
|
---|
419 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amsa.ent"/>'
|
---|
420 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amsb.ent"/>'
|
---|
421 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amsc.ent"/>'
|
---|
422 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amsn.ent"/>'
|
---|
423 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amso.ent"/>'
|
---|
424 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-amsr.ent"/>'
|
---|
425 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-box.ent"/>'
|
---|
426 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-cyr1.ent"/>'
|
---|
427 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-cyr2.ent"/>'
|
---|
428 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-dia.ent"/>'
|
---|
429 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-grk1.ent"/>'
|
---|
430 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-grk2.ent"/>'
|
---|
431 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-grk3.ent"/>'
|
---|
432 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-grk4.ent"/>'
|
---|
433 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-lat1.ent"/>'
|
---|
434 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-lat2.ent"/>'
|
---|
435 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-num.ent"/>'
|
---|
436 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES Publishing//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-pub.ent"/>'
|
---|
437 | $(QUIET)$(APPEND) [email protected] ' <public publicId="ISO 8879:1986//ENTITIES General Technical//EN" uri="file:///$(DOCBOOKDTDPATH)/ent/iso-tech.ent"/>'
|
---|
438 | $(QUIET)$(APPEND) [email protected] '</catalog>'
|
---|
439 | $(QUIET)$(MV) -f [email protected] $@
|
---|
440 | endif
|
---|
441 |
|
---|
442 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
443 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/docbook-htmlhelp-formatcfg.xsl): \
|
---|
444 | $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
445 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
446 | $(QUIET)$(RM) -f [email protected] $@
|
---|
447 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(DOCBOOKPATH)|g' \
|
---|
448 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
449 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
450 | $(QUIET)$(MV) -f [email protected] $@
|
---|
451 |
|
---|
452 | # Prepare the XSL file for our title page, htmlhelp variant.
|
---|
453 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/titlepage-htmlhelp.xsl): \
|
---|
454 | $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
455 | $(call MSG_L1,xsltproc $<)
|
---|
456 | $(QUIET)$(RM) -f [email protected] $@
|
---|
457 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o [email protected] $(DOCBOOKPATH)/template/titlepage.xsl $<
|
---|
458 | $(QUIET)$(MV) -f [email protected] $@
|
---|
459 |
|
---|
460 |
|
---|
461 | ##########################################################################################
|
---|
462 | #
|
---|
463 | # Shared rules for PDF generation
|
---|
464 | #
|
---|
465 | ##########################################################################################
|
---|
466 |
|
---|
467 | ifndef VBOX_OSE
|
---|
468 | # copy ucs.sty and related files
|
---|
469 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
|
---|
470 | $(call MSG_L1,Copying unicode support for LaTeX)
|
---|
471 | $(QUIET)$(CP) $(VBOX_MANUAL_TEX_UNICODE_FILES) $(@D)
|
---|
472 | endif
|
---|
473 |
|
---|
474 | # copy the PNG files.
|
---|
475 | # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
|
---|
476 | define def_vbox_cp_images_pdf
|
---|
477 | local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
|
---|
478 | $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
|
---|
479 | $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
|
---|
480 | $$(call MSG_L1,Copying temporary $$< => $$@)
|
---|
481 | $$(QUIET)$$(CP) -f $$< $$@
|
---|
482 | endef
|
---|
483 |
|
---|
484 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_pdf)))
|
---|
485 |
|
---|
486 |
|
---|
487 | ##########################################################################################
|
---|
488 | #
|
---|
489 | # UserManual.pdf
|
---|
490 | #
|
---|
491 | ##########################################################################################
|
---|
492 |
|
---|
493 | ## @todo INSTALLS target for this!
|
---|
494 | $(PATH_BIN)/UserManual.pdf: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf | $$(dir $$@)
|
---|
495 | $(QUIET)$(CP) $< $@
|
---|
496 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
497 |
|
---|
498 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/UserManual_$(f).pdf): \
|
---|
499 | $(PATH_BIN)/UserManual_%.pdf : $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf
|
---|
500 | $(QUIET)$(CP) $< $@
|
---|
501 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
502 |
|
---|
503 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.pdf): \
|
---|
504 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.pdf : \
|
---|
505 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex \
|
---|
506 | $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/%/ucs.sty) \
|
---|
507 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),\
|
---|
508 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/,$(VBOX_MANUAL_PNG_FILES_$(f)))) | $$(dir $$@)
|
---|
509 | # PDF generation via Latex: generate the .tex file
|
---|
510 | $(call MSG_L1,pdflatex $< (three passes) -> $@)
|
---|
511 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(PDFLATEX) UserManual.tex
|
---|
512 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(PDFLATEX) UserManual.tex
|
---|
513 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(PDFLATEX) UserManual.tex
|
---|
514 | $(QUIET)$(REDIRECT) -w+ti /dev/null -C $(@D) -- $(PDFLATEX) UserManual.tex
|
---|
515 | ##@todo restore this when above has been converted to INSTALLS target. $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
516 |
|
---|
517 | # generate temporary LaTeX source from processed XML
|
---|
518 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/UserManual.tex): \
|
---|
519 | $(VBOX_PATH_MANUAL_OUTBASE)/%/UserManual.tex : \
|
---|
520 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
521 | $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
|
---|
522 | $(MAKEFILE_CURRENT)
|
---|
523 | $(call MSG_L1,Generating $@ from DocBook XML)
|
---|
524 | $(QUIET)$(RM) -f $(addprefix $(@D)/,$(VBOX_MANUAL_LATEX_FILES_TARGET))
|
---|
525 | # generate TeX source from processed docbook and store it in UserManual.tex.tmp;
|
---|
526 | # pass current language to xsltproc in TARGETLANG variable (extract it from the
|
---|
527 | # current directory, should become "de_DE" or the like)
|
---|
528 | $(QUIET)$(VBOX_XSLTPROC) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG $(notdir $(@D)) -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
|
---|
529 | # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
|
---|
530 | # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
|
---|
531 | $(QUIET)$(SED) \
|
---|
532 | -e 's|^\\QUOTE{}|\\OQ{}|g' \
|
---|
533 | -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
|
---|
534 | -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
|
---|
535 | --output $@ [email protected]
|
---|
536 | $(QUIET)$(RM) -f [email protected]
|
---|
537 |
|
---|
538 |
|
---|
539 | ##########################################################################################
|
---|
540 | #
|
---|
541 | # SDKRef.pdf
|
---|
542 | #
|
---|
543 | ##########################################################################################
|
---|
544 |
|
---|
545 | $(VBOX_PATH_SDK)/docs/SDKRef.pdf: \
|
---|
546 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
|
---|
547 | $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
|
---|
548 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
|
---|
549 | # PDF generation via Latex: generate the .tex file
|
---|
550 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/docs
|
---|
551 | $(call MSG_L1,pdflatex $< (three passes))
|
---|
552 | $(QUIET)$(REDIRECT) -C $(<D) -- $(PDFLATEX) SDKRef.tex
|
---|
553 | $(QUIET)$(REDIRECT) -C $(<D) -- $(PDFLATEX) SDKRef.tex
|
---|
554 | $(QUIET)$(REDIRECT) -C $(<D) -- $(PDFLATEX) SDKRef.tex
|
---|
555 | $(QUIET)$(CP) $(<D)/SDKRef.pdf $@
|
---|
556 | $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
|
---|
557 |
|
---|
558 | # generate temporary LaTeX source from processed XML
|
---|
559 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_SDKREF_XML_FILES)) $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $(MAKEFILE_CURRENT)
|
---|
560 | $(call MSG_L1,Generating $@ from DocBook XML)
|
---|
561 | $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
|
---|
562 | # generate TeX source from processed docbook and store it in SDKRef.tex.tmp
|
---|
563 | $(QUIET)$(VBOX_XSLTPROC) $(XSLTPROC_VERBOSE) --xinclude --nonet --stringparam TARGETLANG en_US -o [email protected] $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
|
---|
564 | # for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
|
---|
565 | # the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
|
---|
566 | $(QUIET)$(SED) \
|
---|
567 | -e 's|^\\QUOTE{}|\\OQ{}|g' \
|
---|
568 | -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
|
---|
569 | -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
|
---|
570 | --output $@ [email protected]
|
---|
571 | $(QUIET)$(RM) -f [email protected]
|
---|
572 |
|
---|
573 |
|
---|
574 | ##########################################################################################
|
---|
575 | #
|
---|
576 | # VirtualBox.chm
|
---|
577 | #
|
---|
578 | ##########################################################################################
|
---|
579 |
|
---|
580 | #
|
---|
581 | # Main rule for the .chm file (target of OTHERS at the top):
|
---|
582 | # We first generate a .hhp help source file from the preprocessed
|
---|
583 | # DocBook XML files, as defined above, then feed that into the
|
---|
584 | # Microsoft Help Compiler.
|
---|
585 | #
|
---|
586 |
|
---|
587 | ifdef VBOX_WITH_DOCS_CHM
|
---|
588 | $(PATH_BIN)/VirtualBox.chm: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.chm
|
---|
589 | $(QUIET)$(CP) $< $@
|
---|
590 | $(call MSG_L1,Fresh CHM is now at $@)
|
---|
591 |
|
---|
592 | $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_BIN)/VirtualBox_$(f).chm): \
|
---|
593 | $(PATH_BIN)/VirtualBox_%.chm : $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm
|
---|
594 | $(QUIET)$(CP) $< $@
|
---|
595 | $(call MSG_L1,Fresh CHM is now at $@)
|
---|
596 |
|
---|
597 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/VirtualBox.chm): \
|
---|
598 | $(VBOX_PATH_MANUAL_OUTBASE)/%/VirtualBox.chm: \
|
---|
599 | $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp \
|
---|
600 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(f))))
|
---|
601 | $(call MSG_L1,hhc $<,=> $@)
|
---|
602 | $(QUIET)$(RM) -f $@
|
---|
603 | $(QUIET)$(HHC) $(subst /,\\,$<)
|
---|
604 |
|
---|
605 | $(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/HTMLHelp/htmlhelp.hhp): \
|
---|
606 | $(VBOX_PATH_MANUAL_OUTBASE)/%/HTMLHelp/htmlhelp.hhp: \
|
---|
607 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/%/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
608 | $(VBOX_PATH_MANUAL_OUTBASE)/%/docbook-htmlhelp-formatcfg.xsl \
|
---|
609 | $(VBOX_PATH_MANUAL_OUTBASE)/%/titlepage-htmlhelp.xsl \
|
---|
610 | $(XML_CATALOG) \
|
---|
611 | $(XML_CATALOG_DOCBOOK)
|
---|
612 | $(call MSG_L1,xsltproc $<,=> $@)
|
---|
613 | $(QUIET)$(RM) -f $@
|
---|
614 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
615 | $(QUIET)$(if $(XML_CATALOG),XML_CATALOG_FILES=$(XML_CATALOG)) \
|
---|
616 | $(VBOX_XSLTPROC) --xinclude --nonet --output $(@D)/ \
|
---|
617 | --stringparam htmlhelp.chm \
|
---|
618 | $(subst /,\\,$(@D)/../VirtualBox.chm) \
|
---|
619 | $(HTMLHELPOPTS) $(@D)/../docbook-htmlhelp-formatcfg.xsl \
|
---|
620 | $<
|
---|
621 |
|
---|
622 | # copy the PNG files.
|
---|
623 | # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
|
---|
624 | define def_vbox_cp_images_html
|
---|
625 | local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
|
---|
626 | $$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
|
---|
627 | $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
|
---|
628 | $$(call MSG_L1,Copying temporary $$< => $$@)
|
---|
629 | $$(QUIET)$$(CP) -f $$< $$@
|
---|
630 | endef
|
---|
631 |
|
---|
632 | $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_html)))
|
---|
633 |
|
---|
634 | # Packing the docs into a zip file
|
---|
635 | $(PATH_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
|
---|
636 | $(call MSG_L1,Packing documentation $@)
|
---|
637 | $(QUIET)$(RM) -f $@
|
---|
638 | $(QUIET)$(REDIRECT) -C $(PATH_BIN) -- zip$(HOSTSUFF_EXE) -9 $@ $(notdir $^)
|
---|
639 | endif # VBOX_WITH_DOCS_CHM
|
---|
640 |
|
---|
641 | ##########################################################################################
|
---|
642 | #
|
---|
643 | # UserManual.html
|
---|
644 | #
|
---|
645 | ##########################################################################################
|
---|
646 |
|
---|
647 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
648 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl: \
|
---|
649 | $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
650 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
651 | $(QUIET)$(RM) -f [email protected] $@
|
---|
652 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(DOCBOOKPATH)|g' \
|
---|
653 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
654 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
655 | $(QUIET)$(MV) -f [email protected] $@
|
---|
656 |
|
---|
657 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl: \
|
---|
658 | $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
659 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
660 | $(QUIET)$(RM) -f [email protected] $@
|
---|
661 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(DOCBOOKPATH)|g' \
|
---|
662 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
663 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
664 | $(QUIET)$(MV) -f [email protected] $@
|
---|
665 |
|
---|
666 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
|
---|
667 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
|
---|
668 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml \
|
---|
669 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
670 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
|
---|
671 | $(call MSG_L1,xsltproc $<)
|
---|
672 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet \
|
---|
673 | --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
|
---|
674 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-one-page-formatcfg.xsl \
|
---|
675 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
|
---|
676 |
|
---|
677 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
|
---|
678 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
|
---|
679 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml \
|
---|
680 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_FILES_INCL_CHANGELOG)) \
|
---|
681 | $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
|
---|
682 | $(call MSG_L1,xsltproc $<)
|
---|
683 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet \
|
---|
684 | --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
|
---|
685 | --stringparam chunk.section.depth 0 \
|
---|
686 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-html-chunks-formatcfg.xsl \
|
---|
687 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.xml
|
---|
688 |
|
---|
689 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
|
---|
690 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
|
---|
691 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
|
---|
692 | $(call MSG_L1,Packing documentation $@)
|
---|
693 | $(QUIET)$(RM) -f $@
|
---|
694 | $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- zip$(HOSTSUFF_EXE) \
|
---|
695 | -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
|
---|
696 |
|
---|
697 | html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
|
---|
698 |
|
---|
699 | html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
|
---|
700 |
|
---|
701 | html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
|
---|
702 |
|
---|
703 | ##########################################################################################
|
---|
704 | #
|
---|
705 | # ChangeLog.html
|
---|
706 | #
|
---|
707 | ##########################################################################################
|
---|
708 |
|
---|
709 | # intermediate step to do some variable replacement in the XSL configuration
|
---|
710 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-changelog-formatcfg.xsl: \
|
---|
711 | $(VBOX_PATH_MANUAL_SRC)/docbook-changelog-formatcfg.xsl $(MAKEFILE_CURRENT) | $$(dir $$@)
|
---|
712 | $(call MSG_L1,Pre-processing $(@F) to $@)
|
---|
713 | $(QUIET)$(RM) -f [email protected] $@
|
---|
714 | $(QUIET)$(SED) -e 's|\$$DOCBOOKPATH|$(DOCBOOKPATH)|g' \
|
---|
715 | -e 's|\$$CFGPATH|$(VBOX_PATH_MANUAL_SRC)|g' \
|
---|
716 | -e 's|\$$TARGETPATH|$(@D)|g' --output [email protected] $<
|
---|
717 | $(QUIET)$(MV) -f [email protected] $@
|
---|
718 |
|
---|
719 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.xml: ChangeLog.xml
|
---|
720 | $(QUIET)$(CP) $< $@
|
---|
721 |
|
---|
722 | $(VBOX_PATH_MANUAL_OUTBASE)/user_ChangeLogImpl_1.xml: $(VBOX_PATH_MANUAL_SRC)/user_ChangeLogImpl.xml
|
---|
723 | $(QUIET)$(RM) -f [email protected] $@
|
---|
724 | $(QUIET)$(SED) -e 's|para|simpara|g' \
|
---|
725 | --output [email protected] $<
|
---|
726 | $(QUIET)$(MV) -f [email protected] $@
|
---|
727 |
|
---|
728 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
|
---|
729 | $(VBOX_PATH_MANUAL_OUTBASE)/user_ChangeLogImpl_1.xml \
|
---|
730 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/docbook-changelog-formatcfg.xsl \
|
---|
731 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.xml
|
---|
732 | $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html \
|
---|
733 | $(@D)/docbook-changelog-formatcfg.xsl \
|
---|
734 | $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.xml
|
---|
735 |
|
---|
736 | $(PATH_BIN)/ChangeLog.html: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
|
---|
737 | $(QUIET)$(CP) $< $@
|
---|
738 | $(call MSG_L1,Fresh ChangeLog.html is now at $@)
|
---|
739 |
|
---|
740 | cl-html: $(PATH_BIN)/ChangeLog.html
|
---|
741 |
|
---|
742 | include $(KBUILD_PATH)/subfooter.kmk
|
---|
743 |
|
---|