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