VirtualBox

source: vbox/trunk/doc/manual/Makefile.kmk@ 79156

Last change on this file since 79156 was 78145, checked in by vboxsync, 6 years ago

manual/Config.kmk: Catalog fix. Whitespace.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.5 KB
Line 
1# $Id: Makefile.kmk 78145 2019-04-16 14:17:30Z vboxsync $
2## @file
3# Sub-Makefile for the VirtualBox User Manual, SDK reference and other manuals.
4#
5
6#
7# Copyright (C) 2006-2019 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
48SUB_DEPTH = ../..
49include $(KBUILD_PATH)/subheader.kmk
50
51ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
52 include $(PATH_SUB_CURRENT)/Config.kmk
53endif
54
55
56#
57# Globals
58#
59
60# Error out if someone tries to override old globals.
61ifdef HTMLHELPOPTS
62 $(error HTMLHELPOPTS was renamed to VBOX_HTMLHELP_OPTS!)
63endif
64ifdef DOCBOOKPATH
65 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
66endif
67ifdef DOCBOOKPATH
68 $(error DOCBOOKPATH was renamed to VBOX_PATH_DOCBOOK!)
69endif
70ifdef XML_CATALOG
71 $(error XML_CATALOG was renamed to VBOX_XML_CATALOG!)
72endif
73ifdef XML_CATALOG_DOCBOOK
74 $(error XML_CATALOG_DOCBOOK was renamed to VBOX_XML_CATALOG_DOCBOOK!)
75endif
76ifdef VBOXMANAGEPATH
77 $(error VBOXMANAGEPATH was renamed to VBOXMANAGEHELP_PATH!)
78endif
79ifdef PDFLATEX_INTERACTION
80 $(error PDFLATEX_INTERACTION was renamed to VBOX_PDFLATEX_INTERACTION!)
81endif
82ifdef PDFLATEX
83 $(error PDFLATEX was renamed to VBOX_PDFLATEX_CMD!)
84endif
85ifdef HHC
86 $(error HHC was renamed to VBOX_HHC!)
87endif
88
89
90
91VBOXMANAGEHELP_PATH ?= $(PATH_STAGE_BIN)/VBoxManageHelp$(SUFF_EXE)
92
93 # VBOX_PDFLATEX_INTERACTION = errorstopmode - Use this when you wants to figure out build failures
94 # without catting the log a million times.
95VBOX_PDFLATEX_INTERACTION ?= batchmode
96ifeq ($(KBUILD_HOST),win)
97 ifndef VBOX_PDFLATEX
98 VBOX_PDFLATEX := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/win.x86/miktex-portable/*/miktex/bin/pdflatex.exe)))
99 ifneq ($(VBOX_PDFLATEX),)
100 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION)
101 endif
102 endif
103 ifndef VBOX_PDFLATEX
104 # Tell MiKTeX to automatically download packages if system wide install.
105 VBOX_PDFLATEX := pdflatex
106 VBOX_PDFLATEX_CMD = $(VBOX_PDFLATEX) -halt-on-error -interaction $(VBOX_PDFLATEX_INTERACTION) --enable-installer
107 endif
108else
109 VBOX_PDFLATEX ?= pdflatex
110 VBOX_PDFLATEX_HALT = $(shell ( $(VBOX_PDFLATEX) -version | head -1 | grep 141592 > /dev/null ) && echo -halt-on-error )
111 VBOX_PDFLATEX_CMD = pdflatex $(VBOX_PDFLATEX_HALT) -interaction $(VBOX_PDFLATEX_INTERACTION)
112endif
113
114# Windows HTML Help Workshop compiler (stupid thing always returns an error!)
115VBOX_HHC = -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe
116
117
118# Additional xsltproc options when generating
119VBOX_HTMLHELP_OPTS ?=
120
121# SDK related globals.
122VBOX_MANUAL_APIREF_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef_apiref.xml
123VBOX_DOC_XIDL_SRC = $(PATH_ROOT)/src/VBox/Main/idl/VirtualBox.xidl
124VBOX_DOC_XIDL_SRC_TMP = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.xidl.tmp
125
126
127#
128# Targets
129#
130
131BLDDIRS += $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/, $(VBOX_MANUAL_LANGUAGES))
132
133if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
134 if defined(VBOX_ONLY_SDK) || defined(VBOX_WITH_DOCS_SDKREF)
135 INSTALLS += VBox-docs-sdkref
136 endif
137
138 ifdef VBOX_WITH_DOCS_HTML
139 INSTALLS += VBox-docs-usermanual-html
140 VBOX_PATH_BIN_HTML = $(PATH_STAGE_BIN)/UserManual-html.zip
141 else # Do not build html.
142 VBOX_PATH_BIN_HTML =
143 endif
144
145 ifdef VBOX_WITH_DOCS_CHM
146 INSTALLS += VBox-docs-usermanual-chm
147 VBOX_PATH_BIN_CHM = $(PATH_STAGE_BIN)/VirtualBox.chm
148 else # Do not build chm.
149 VBOX_PATH_BIN_CHM =
150 endif
151
152 ifndef VBOX_ONLY_SDK
153 VBOX_MANUAL_PACK += \
154 $(PATH_STAGE_BIN)/UserManual.pdf \
155 $(VBOX_PATH_BIN_HTML) \
156 $(VBOX_PATH_BIN_CHM)
157 INSTALLS += VBox-docs-usermanual
158
159 ifdef VBOX_WITH_DOCS_TRANSLATIONS
160 INSTALLS += VBox-docs-usermanual-l10n
161 VBOX_MANUAL_PACK += \
162 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf)
163 ifdef VBOX_WITH_DOCS_CHM
164 INSTALLS += VBox-docs-usermanual-l10n-chm
165 VBOX_MANUAL_PACK += \
166 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm)
167 endif
168 endif
169 endif # !VBOX_ONLY_SDK
170
171 ifdef VBOX_WITH_DOCS_ACCESSIBILITY
172 INSTALLS += VBox-docs-accessibility
173 INSTALLS += VBox-docs-accessibility-html
174 endif
175
176 ifdef VBOX_ONLY_DOCS
177 PACKING += $(PATH_STAGE_BIN)/VBoxDocumentation.zip
178 endif
179
180 ifdef VBOX_WITH_DOCS_TRANSLATIONS
181 VBOX_MANUAL_LANGUAGES += $(VBOX_MANUAL_ADD_LANGUAGES)
182 endif
183
184$(foreach lang,$(VBOX_MANUAL_LANGUAGES), \
185 $(eval VBOX_MANUAL_XML_FILES_GENERATED_$$(lang) := \
186 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
187 $$(addprefix $$(VBOX_PATH_MANUAL_OUTBASE)/overview_,$$(filter man_VBoxManage%,$$(VBOX_MANUAL_XML_REFENTRY_FILES))) \
188 $$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
189 $$(VBOX_PATH_MANUAL_OUTBASE)/$$(lang)/user_isomakercmd-man.xml))
190
191 VBOX_SDKREF_XML_FILES = \
192 SDKRef.xml
193
194 VBOX_ACCESSIBILITY_XML_FILES = \
195 Accessibility.xml
196
197 # Wildcard the images path for every supported language
198 $(foreach f,$(VBOX_MANUAL_LANGUAGES), \
199 $(eval VBOX_MANUAL_PNG_FILES_$$(f) := $$(patsubst $$(VBOX_PATH_MANUAL_SRC)/$$(f)/%,%,$$(wildcard $$(VBOX_PATH_MANUAL_SRC)/$$(f)/images/*.png))))
200
201 VBOX_MANUAL_TEX_UNICODE_FILES = \
202 $(wildcard $(VBOX_PATH_MANUAL_SRC)/texfiles/unicode/*)
203
204 VBOX_MANUAL_LATEX_FILES_TARGET = \
205 $(addprefix UserManual.,aux log out toc tex)
206
207 VBOX_SDKREF_LATEX_FILES_TARGET = \
208 $(addprefix SDKRef.,aux log out toc tex)
209
210 VBOX_ACCESSIBILITY_LATEX_FILES_TARGET = \
211 $(addprefix Accessibility.,aux log out toc tex)
212
213 BLDDIRS += \
214 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/,\
215 $(addsuffix /images, $(VBOX_MANUAL_LANGUAGES)) \
216 $(addsuffix /html-single, $(VBOX_MANUAL_LANGUAGES)) \
217 $(addsuffix /html-chunks, $(VBOX_MANUAL_LANGUAGES)) \
218 $(addsuffix /HTMLHelp, $(VBOX_MANUAL_LANGUAGES)) \
219 $(addsuffix /HTMLHelp/images, $(VBOX_MANUAL_LANGUAGES)) \
220 )
221
222 # Explicit cleaning has some overlap with default cleaning rules, since this
223 # Makefile is using very complex conditionals for selectively creating
224 # specific files, and not everyone remembers to use the same with "kmk clean".
225 OTHER_CLEAN += \
226 $(VBOX_XML_CATALOG) \
227 $(VBOX_XML_CATALOG_DOCBOOK) \
228 $(VBOX_XML_CATALOG_MANUAL) \
229 $(VBOX_XML_ENTITIES) \
230 $(VBOX_XML_XREF_TO_TEXT) \
231 $(VBOX_XML_XREF_TO_TEXT).cat \
232 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/, \
233 $(addprefix user_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
234 $(VBOX_MANUAL_XML_REFENTRY_FILES) \
235 $(patsubst man_%,%.1,$(basename $(VBOX_MANUAL_XML_REFENTRY_FILES))) \
236 isomakercmd-man.xml \
237 user_isomakercmd-man.xml \
238 $(VBOX_MANUAL_LATEX_FILES_TARGET) \
239 $(VBOX_MANUAL_PNG_FILES_$(lang)) \
240 $(notdir $(VBOX_MANUAL_TEX_UNICODE_FILES)) \
241 $(addprefix HTMLHelp/,$(VBOX_MANUAL_PNG_FILES_$(lang))) \
242 html-single/UserManual.html \
243 $(addprefix HTMLHelp/, index.html go01.html) \
244 $(addprefix html-chunks/, index.html go01.html) \
245 $(foreach n,01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 \
246 ,html-chunks/ch$(n).html \
247 html-chunks/re$(n).html \
248 HTMLHelp/ch$(n).html \
249 HTMLHelp/re$(n).html \
250 $(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)) ) \
251 $(foreach n,a b c \
252 ,html-chunks/ap$(n).html \
253 HTMLHelp/ap$(n).html \
254 $(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) ) \
255 $(foreach n,01 02 03 04 05 \
256 ,html-chunks/pr$(n).html \
257 HTMLHelp/pr$(n).html \
258 $(foreach s,01 02 03 04 05 06 07 08,HTMLHelp/pr$(n)s$(s).html) ) \
259 HTMLHelp/toc.hhc \
260 HTMLHelp/htmlhelp.hhp \
261 UserManual.pdf \
262 VirtualBox.chm \
263 ChangeLog.html \
264 validatemanual.run \
265 validateaccessibility.run \
266 validatesdkref.run \
267 )) \
268 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
269 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
270 $(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml \
271 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/UserManual_$(f).pdf) \
272 $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(PATH_STAGE_BIN)/VirtualBox_$(f).chm) \
273 $(PATH_STAGE_BIN)/UserManual.pdf \
274 $(PATH_STAGE_BIN)/VirtualBox.chm \
275 \
276 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
277 $(VBOX_SDKREF_LATEX_FILES_TARGET) \
278 SDKRef.pdf \
279 ) \
280 $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf \
281 \
282 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/, \
283 $(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET) \
284 html-single/Accessibility.html \
285 Accessibility.pdf \
286 ) \
287 $(PATH_STAGE_BIN)/Accessibility.html \
288 $(PATH_STAGE_BIN)/Accessibility.pdf \
289 \
290 $(VBOX_DOC_XIDL_SRC_TMP) \
291 $(VBOX_MANUAL_APIREF_TMP)
292
293endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
294
295#
296# target for installing UserManual.pdf
297#
298VBox-docs-usermanual_INST = $(INST_BIN)
299VBox-docs-usermanual_MODE = a+r,u+w
300VBox-docs-usermanual_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.pdf
301
302#
303# target for installing translated UserManual_*.pdf
304#
305VBox-docs-usermanual-l10n_INST = $(INST_BIN)
306VBox-docs-usermanual-l10n_MODE = a+r,u+w
307VBox-docs-usermanual-l10n_SOURCES = $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/UserManual.pdf=>UserManual_$(f).pdf)
308
309#
310# target for installing the chunked HTML docs
311#
312VBox-docs-usermanual-html_INST = $(INST_BIN)
313VBox-docs-usermanual-html_MODE = a+r,u+w
314VBox-docs-usermanual-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip=>UserManual-html.zip
315
316#
317# target for installing VirtualBox.chm
318#
319VBox-docs-usermanual-chm_INST = $(INST_BIN)
320VBox-docs-usermanual-chm_MODE = a+r,u+w
321VBox-docs-usermanual-chm_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/VirtualBox.chm
322
323#
324# target for installing translated VirtualBox_*.chm
325#
326VBox-docs-usermanual-l10n-chm_INST = $(INST_BIN)
327VBox-docs-usermanual-l10n-chm_MODE = a+r,u+w
328VBox-docs-usermanual-l10n-chm_SOURCES = $(foreach f,$(VBOX_MANUAL_ADD_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$(f)/VirtualBox.chm=>VirtualBox_$(f).chm)
329
330#
331# target for installing SDKRef.pdf
332#
333VBox-docs-sdkref_INST = $(INST_SDK)docs/
334VBox-docs-sdkref_MODE = a+r,u+w
335VBox-docs-sdkref_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf
336
337#
338# target for installing Accessibility.pdf
339#
340VBox-docs-accessibility_INST = $(INST_BIN)
341VBox-docs-accessibility_MODE = a+r,u+w
342VBox-docs-accessibility_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf
343
344#
345# target for installing Accessibility.html
346#
347VBox-docs-accessibility-html_INST = $(INST_BIN)
348VBox-docs-accessibility-html_MODE = a+r,u+w
349VBox-docs-accessibility-html_SOURCES = $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
350
351
352
353if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
354
355##
356# Morph man pages into manual sections.
357# $(evalcall2 def_vbox_refentry_to_user_sect1)
358# @param 1 Language.
359# @param 2 the refentry xml base file name.
360# @param 3 the full refentry xml file path.
361define def_vbox_refentry_to_user_sect1
362$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/user_$(2): $(3) \
363 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl \
364 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
365 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
366 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(filter %.xml,$$^),$$@)
367 $$(QUIET)$$(RM) -f "$$@"
368 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-sect1.xsl $$<
369endef
370$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
371, $(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),$(file),$(VBOX_PATH_MANUAL_SRC)/$(lang)/$(file))))
372$(foreach lang,$(VBOX_MANUAL_LANGUAGES) \
373,$(evalcall2 def_vbox_refentry_to_user_sect1,$(lang),isomakercmd-man.xml,$(PATH_ROOT)/src/VBox/Runtime/common/fs/isomakercmd-man.xml))
374
375
376# Generates the VBoxManage command overview include file (shared between
377# languages) from the refsynopsisdiv section of the man pages.
378$(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/overview_,$(VBOX_MANUAL_XML_REFENTRY_FILES)): \
379 $(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manual-overview.xsl \
380 $$(patsubst overview_%,$$(VBOX_PATH_MANUAL_SRC)/en_US/%,$$(notdir $$@)) \
381 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
382 | $$(dir $$@)
383 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
384 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" $< $(filter %.xml,$^)
385
386$(VBOX_PATH_MANUAL_OUTBASE)/user_VBoxManage_CommandsOverview.xml: $(VBOXMANAGEHELP_PATH) $(MAKEFILE_CURRENT) | $$(dir $$@)
387 $(call MSG_GENERATE,,$@,)
388 $(QUIET)$(RM) -f $@ $@.dumpopts
389 $(QUIET)$(APPEND) -tn "$@" \
390 '<?xml version="1.0" encoding="UTF-8"?>' \
391 '<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">' \
392 '<sect1> <!-- this will be skipped via xpointer in the include. --> '
393 $(QUIET)$(REDIRECT) -wo $@.dumpopts -E 'VBOX_LOG_FLAGS=disabled' -E 'VBOX_LOG_DEST=nofile' \
394 $(if $(eq $(KBUILD_TARGET),darwin), -E 'DYLD_FALLBACK_LIBRARY_PATH=$(dir $(LIB_RUNTIME))') \
395 -- \
396 $(VBOXMANAGEHELP_PATH) --dumpopts
397 $(QUIET)$(SED) \
398 -e ':a' \
399 -e 'N' \
400 -e '$(DOLLAR)!ba' \
401 -e 's/</\&lt\;/g' \
402 -e 's/>/\&gt\;/g' \
403 -e 's/\n*$(DOLLAR)/<\/screen>/' \
404 -e 's/^/<screen>/' \
405 --append $@ $@.dumpopts
406 $(QUIET)$(RM) -f $@.dumpopts
407 $(QUIET)$(APPEND) -n "$@" \
408 ' <remark role="VBoxManage-overview">' \
409 $(foreach refentry, $(filter man_VBoxManage%,$(VBOX_MANUAL_XML_REFENTRY_FILES)) \
410 , ' <xi:include href="overview_$(refentry)" xpointer="element(/1)" xmlns:xi="http://www.w3.org/2001/XInclude" />') \
411 ' </remark>' \
412 '</sect1>'
413
414
415
416
417##########################################################################################
418#
419# Shared rules for PDF generation
420#
421##########################################################################################
422
423ifndef VBOX_OSE
424# copy ucs.sty and related files
425$(foreach f,$(VBOX_MANUAL_LANGUAGES),$(VBOX_PATH_MANUAL_OUTBASE)/$f/ucs.sty):
426 $(call MSG_L1,Copying unicode support for LaTeX)
427 $(QUIET)$(INSTALL_STAGING) -m0644 -- $(VBOX_MANUAL_TEX_UNICODE_FILES) "$(@D)"
428endif
429
430# copy the PNG files.
431# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
432define def_vbox_cp_images_pdf
433local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
434$(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
435 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
436 $$(call MSG_L1,Copying temporary $$< => $$@)
437 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
438endef
439$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_cp_images_pdf))
440
441
442##########################################################################################
443#
444# UserManual.pdf
445#
446##########################################################################################
447
448
449# Generate PDF from LaTeX
450# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
451define def_vbox_usermanual_tex_to_pdf
452local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
453$$(out_dir)/UserManual.pdf: \
454 $$(out_dir)/UserManual.tex \
455 $$(if $$(VBOX_OSE),,$$(out_dir)/ucs.sty) \
456 $$(addprefix $$(out_dir)/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) | $$$$(dir $$$$@)
457# PDF generation via Latex: generate the .tex file
458 $$(call MSG_L1,pdflatex $$< (four passes) -> $$@)
459 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
460 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
461 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
462 $$(QUIET)$$(REDIRECT) -w+ti /dev/null -C $$(@D) -- $$(VBOX_PDFLATEX_CMD) UserManual.tex
463 $$(QUIET)$$(SED) -ne '/Warning: Hyper reference/p' $$(basename $$<).log
464 $$(QUIET)$$(SED) -n \
465 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
466 $$(basename $$@).log
467 $$(call MSG_L1,Fresh LaTeX-generated PDF is now at $$@)
468endef
469$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_tex_to_pdf))
470
471# Generate LaTeX from XML
472# Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
473define def_vbox_usermanual_xml_to_tex
474local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
475$$(out_dir)/UserManual.tex: \
476 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
477 $$(VBOX_MANUAL_XML_FILES_COMMON) \
478 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
479 $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
480 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
481 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
482 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
483 $$(call MSG_TOOL,xsltproc $$(notdir $$(filter %.xsl,$$^)),,$$(firstword $$(filter %.xml,$$^)),$$@)
484 $$(QUIET)$$(RM) -f $$(addprefix $$(@D)/,$$(VBOX_MANUAL_LATEX_FILES_TARGET))
485# generate TeX source from processed docbook and store it in UserManual.tex.tmp;
486# pass current language to xsltproc in TARGETLANG variable
487 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG $(lang) \
488 -o $$@.tmp $$(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $$<
489# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
490# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
491 $$(QUIET)$$(SED) \
492 -e 's|^\\QUOTE{}|\\OQ{}|g' \
493 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
494 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
495 --output $$@ $$@.tmp
496 $$(QUIET)$$(RM) -f $$@.tmp
497endef
498$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_tex))
499
500# Useful aliases
501usermanual UserManual.pdf:: $(PATH_STAGE_BIN)/UserManual.pdf
502
503debug-usermanual:
504 $(MAKE) --pretty-command-printing -j1 VBOX_PDFLATEX_INTERACTION=errorstopmode $(PATH_STAGE_BIN)/UserManual.pdf
505
506#
507# Generate rules for validating the UserManual.xml. These are invoked
508# automatically at build time, but can also be manually invoked via the
509# 'validatemanual' and 'validatemanual_<lang>' aliases.
510#
511define def_vbox_validate_xml
512validatemanual_$(lang):: $$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run
513$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/validatemanual.run: \
514 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
515 $$(VBOX_MANUAL_XML_FILES_COMMON) \
516 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
517 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
518 $$(VBOX_XML_ENTITIES) $$(MAKEFILE_CURRENT) | $$$$(dir $$$$@)
519 $$(call MSG_L1,Validating $$<)
520 $$(QUIET)$$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$<
521 $$(QUIET)$$(APPEND) -t "$$@" "done"
522endef
523$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_validate_xml))
524
525
526# Handy aliases.
527validatemanual:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),validatemanual_$(lang))
528
529
530
531#
532# SDKRef.pdf
533#
534
535# Replace <tt> tags in VirtualBox.xidl.
536$(VBOX_DOC_XIDL_SRC_TMP): $(VBOX_DOC_XIDL_SRC) $(MAKEFILE_CURRENT) | $$(dir $$@)
537 $(call MSG_L1,Generating $@)
538 $(QUIET)$(SED) -e 's|@a \+\(\w\+\)|<tt>\1</tt>|g' \
539 -e 's|@c \+\(\w\+\)|<tt>\1</tt>|g' \
540 --output $@ $<
541
542# Generate SDKRef_apiref.xml as a docbook file excerpt that will be referenced from the SDKRef.xml.
543$(VBOX_MANUAL_APIREF_TMP): $(VBOX_PATH_MANUAL_SRC)/xidl2docbook.xsl $(VBOX_DOC_XIDL_SRC_TMP)
544 $(call MSG_L1,Generating $@)
545 $(QUIET)$(VBOX_XSLTPROC) $(VBOX_XSLTPROC_OPTS) --xinclude --nonet -o $@ $< $(VBOX_DOC_XIDL_SRC_TMP)
546
547# Turn SDKRef.xml into LaTeX.
548$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex: \
549 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
550 $(VBOX_MANUAL_APIREF_TMP) \
551 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
552 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run,) \
553 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
554 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
555 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
556 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_SDKREF_LATEX_FILES_TARGET))
557# generate TeX source from processed docbook and store it in SDKRef.tex.tmp
558 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
559 -o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
560# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
561# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
562 $(QUIET)$(SED) \
563 -e 's|^\\QUOTE{}|\\OQ{}|g' \
564 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
565 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
566 --output $@ $@.tmp
567 $(QUIET)$(RM) -f $@.tmp
568
569# Turn SDKRef.tex into a PDF.
570$(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.pdf: \
571 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/SDKRef.tex \
572 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
573 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
574 $(call MSG_L1,pdflatex $< (three passes))
575 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
576 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
577 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) SDKRef.tex
578 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
579 $(QUIET)$(SED) -n \
580 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
581 $(basename $<).log
582 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
583
584# Validating SDKRef.xml. It is invoked automatically at build time,
585# but can also be manually invoked via the 'validate-sdkref' alias.
586$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run: \
587 $(VBOX_PATH_MANUAL_SRC)/en_US/SDKRef.xml \
588 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_SDKREF_XML_FILES)) \
589 $(VBOX_MANUAL_APIREF_TMP) \
590 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
591 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
592 $(call MSG_L1,Validating $<)
593 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
594 $(QUIET)$(APPEND) -t "$@" "done"
595
596
597# Handy aliases.
598validate-sdkref:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatesdkref.run
599sdkref:: $(PATH_STAGE_BIN)/sdk/docs/SDKRef.pdf
600
601
602
603#
604# Accessibility.pdf
605#
606
607# Turn Accessibility.xml into LaTeX.
608$(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex: \
609 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
610 $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl \
611 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run,) \
612 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
613 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
614 $(call MSG_TOOL,xsltproc $(notdir $(filter %.xsl,$^)),,$(firstword $(filter %.xml,$^)),$@)
615 $(QUIET)$(RM) -f $(addprefix $(@D/),$(VBOX_ACCESSIBILITY_LATEX_FILES_TARGET))
616# generate TeX source from processed docbook and store it in Accessibility.tex.tmp
617 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --stringparam TARGETLANG en_US \
618 -o $@.tmp $(VBOX_PATH_MANUAL_SRC)/docbook2latex.xsl $<
619# for pretty quotes, replace " with `` or '' depending on whether it's at the start of a word;
620# the \QUOTE{} was inserted by docbook2latex.xsl for all quotes _outside_ of screen sections
621 $(QUIET)$(SED) \
622 -e 's|^\\QUOTE{}|\\OQ{}|g' \
623 -e 's|\(\W\)\\QUOTE{}|\1\\OQ{}|g' \
624 -e 's|\(\w\)\\QUOTE{}|\1\\CQ{}|g' \
625 --output $@ $@.tmp
626 $(QUIET)$(RM) -f $@.tmp
627
628# Turn Accessibility.tex into a PDF.
629$(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.pdf: \
630 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/Accessibility.tex \
631 $(if $(VBOX_OSE),,$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ucs.sty) \
632 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) | $$(dir $$@)
633 $(call MSG_L1,pdflatex $< (three passes))
634 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
635 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
636 $(QUIET)$(REDIRECT) -C $(<D) -- $(VBOX_PDFLATEX_CMD) Accessibility.tex
637 $(QUIET)$(SED) -ne '/Warning: Hyper reference/p' $(basename $<).log
638 $(QUIET)$(SED) -n \
639 -e '/Warning: There were \(undefined references\|multiply-defined labels\)/{p; q 1}' \
640 $(basename $<).log
641 $(call MSG_L1,Fresh LaTeX-generated PDF is now at $@)
642
643$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html: \
644 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
645 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
646 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
647 $(VBOX_XML_ENTITIES) | $$(dir $$@)
648 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
649 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
650 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html \
651 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
652 $<
653
654# Validating Accessibility.xml. It is invoked automatically at build time,
655# but can also be manually invoked via the 'validate-accessibility' alias.
656$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run: \
657 $(VBOX_PATH_MANUAL_SRC)/en_US/Accessibility.xml \
658 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_ACCESSIBILITY_XML_FILES)) \
659 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
660 $(VBOX_XML_ENTITIES) $(MAKEFILE_CURRENT) | $$(dir $$@)
661 $(call MSG_L1,Validating $<)
662 $(QUIET)$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $<
663 $(QUIET)$(APPEND) -t "$@" "done"
664
665
666# Handy aliases.
667validate-accessibility:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/validateaccessibility.run
668accessibility:: $(PATH_STAGE_BIN)/Accessibility.pdf
669accessibility-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/Accessibility.html
670
671
672
673ifdef VBOX_WITH_DOCS_CHM
674 #
675 # VirtualBox.chm
676 #
677 # We first generate a .hhp help source file from the preprocessed
678 # DocBook XML files, as defined above, then feed that into the
679 # Microsoft Help Compiler.
680 #
681 VBOX_DOCBOOK_HTMLHELP_FORMATCFG = \
682 $(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
683 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
684 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
685
686 # Prepare the XSL file for our title page, htmlhelp variant.
687 $(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl: \
688 $(VBOX_PATH_MANUAL_SRC)/titlepage-htmlhelp.xml $(MAKEFILE_CURRENT) | $$(dir $$@)
689 $(call MSG_L1,xsltproc $<)
690 $(QUIET)$(RM) -f $@.tmp $@
691 $(QUIET)$(VBOX_XSLTPROC) --xinclude --nonet -o $@.tmp $(VBOX_PATH_DOCBOOK)/template/titlepage.xsl $<
692 $(QUIET)$(MV) -f $@.tmp $@
693
694 # Generate CHM from HHP
695 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
696 define def_vbox_usermanual_hhp_to_chm
697 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
698 $$(out_dir)/VirtualBox.chm: \
699 $$(out_dir)/HTMLHelp/htmlhelp.hhp \
700 $$(addprefix $$(out_dir)/HTMLHelp/,$$(VBOX_MANUAL_PNG_FILES_$(lang))) \
701 | $$$$(dir $$$$@)
702 $$(call MSG_L1,hhc $$<,=> $$@)
703 $$(QUIET)$$(RM) -f $$@
704 $$(QUIET)$$(VBOX_HHC) $$(subst /,\\,$$<)
705 $$(call MSG_L1,Fresh CHM is now at $$@)
706 endef
707 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_hhp_to_chm))
708
709 # Generate HHP from XML
710 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
711 define def_vbox_usermanual_xml_to_hhp
712 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)
713 $$(out_dir)/HTMLHelp/htmlhelp.hhp: \
714 $$(addprefix $$(VBOX_PATH_MANUAL_SRC)/$(lang)/,$$(VBOX_MANUAL_XML_FILES)) \
715 $$(VBOX_MANUAL_XML_FILES_COMMON) \
716 $$(VBOX_MANUAL_XML_FILES_GENERATED_$(lang)) \
717 $$(VBOX_DOCBOOK_HTMLHELP_FORMATCFG) \
718 $$(VBOX_PATH_MANUAL_OUTBASE)/titlepage-htmlhelp.xsl \
719 $$(if $$(VBOX_HAVE_XMLLINT),$$(out_dir)/validatemanual.run,) \
720 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
721 $$(VBOX_XML_ENTITIES) | $$$$(dir $$$$@)
722 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
723 $$(QUIET)$$(RM) -f $$@
724 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$(@D)/ \
725 --stringparam htmlhelp.chm \
726 $$(subst /,\\,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/VirtualBox.chm) \
727 $$(HTMLHELPOPTS) $$(VBOX_PATH_MANUAL_SRC)/docbook-htmlhelp-formatcfg.xsl \
728 $$<
729 endef
730 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(evalcall2 def_vbox_usermanual_xml_to_hhp))
731
732 # copy the PNG files.
733 # Note: out_dir needs to be referenced with an escaped $ so it doesn't expand as eval expands it input.
734 define def_vbox_cp_images_htmlhelp
735 local out_dir := $(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/HTMLHelp
736 $(addprefix $$(out_dir)/,$(VBOX_MANUAL_PNG_FILES_$(lang))): \
737 $$(out_dir)/%: $(VBOX_PATH_MANUAL_SRC)/$(lang)/% | $$$$(dir $$$$@)
738 $$(call MSG_L1,Copying temporary $$< => $$@)
739 $$(QUIET)$$(INSTALL_STAGING) -m0644 -- '$$<' '$$(@D)'
740 endef
741 $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(eval $(def_vbox_cp_images_htmlhelp)))
742
743endif # VBOX_WITH_DOCS_CHM
744
745
746# Packing the docs into a zip file
747$(PATH_STAGE_BIN)/VBoxDocumentation.zip: $(VBOX_MANUAL_PACK)
748 $(call MSG_L1,Packing documentation $@)
749 $(QUIET)$(RM) -f $@
750 $(QUIET)$(REDIRECT) -C $(PATH_STAGE_BIN) -- $(VBOX_ZIP) -9 $@ $(notdir $^)
751
752
753##########################################################################################
754#
755# UserManual.html
756#
757##########################################################################################
758VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG = \
759 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
760 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
761 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
762
763$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html: \
764 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
765 $(VBOX_MANUAL_XML_FILES_COMMON) \
766 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
767 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
768 $(VBOX_DOCBOOK_HTML_ONE_PAGE_FORMATCFG) \
769 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
770 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
771 $$(VBOX_XML_ENTITIES) | $$(dir $$@)
772 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
773 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
774 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
775 $(VBOX_PATH_MANUAL_SRC)/docbook-html-one-page-formatcfg.xsl \
776 $<
777
778VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG = \
779 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
780 $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl \
781 $(VBOX_PATH_MANUAL_SRC)/common-html-formatcfg.xsl
782
783$(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html: \
784 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_XML_FILES)) \
785 $(VBOX_MANUAL_XML_FILES_COMMON) \
786 $(VBOX_MANUAL_XML_FILES_GENERATED_en_US) \
787 $(VBOX_DOCBOOK_HTML_CHUNKS_FORMATCFG) \
788 $(addprefix $(VBOX_PATH_MANUAL_SRC)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US)) \
789 $(if $(VBOX_HAVE_XMLLINT),$(VBOX_PATH_MANUAL_OUTBASE)/en_US/validatemanual.run,) \
790 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
791 $(VBOX_XML_ENTITIES) | $$(dir $$@)
792 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
793 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) \
794 --output $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
795 --stringparam chunk.section.depth 0 \
796 $(VBOX_PATH_MANUAL_SRC)/docbook-html-chunks-formatcfg.xsl \
797 $<
798
799$(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip: \
800 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html \
801 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html \
802 $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_PNG_FILES_en_US))
803 $(call MSG_L1,Packing documentation $@)
804 $(QUIET)$(RM) -f $@
805 $(QUIET)$(REDIRECT) -C $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ -- $(VBOX_ZIP) \
806 -9 -r $@ html-single html-chunks $(VBOX_MANUAL_PNG_FILES_en_US)
807
808html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-single/UserManual.html
809html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/html-chunks/index.html
810html-zip:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/UserManual.zip
811
812
813#
814# ChangeLog.html
815#
816# This XSLT rule formats en_US/user_ChangeLog.xml (which includes the actual change log
817# contained in user_ChangeLogImpl.xml) as a standalone HTML file.
818#
819$(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html: \
820 $(VBOX_PATH_MANUAL_SRC)/en_US/docbook-changelog-formatcfg.xsl \
821 $(VBOX_PATH_MANUAL_OUTBASE)/en_US/user_ChangeLog.xml \
822 $(VBOX_XML_CATALOG) $(VBOX_XML_CATALOG_DOCBOOK) $(VBOX_XML_CATALOG_MANUAL) \
823 $(VBOX_XML_ENTITIES) | $$(dir $$@)
824 $(call MSG_TOOL,xsltproc $(notdir $(firstword $(filter %.xsl,$^))),,$(firstword $(filter %.xml,$^)),$@)
825 $(QUIET)$(call VBOX_XSLTPROC_WITH_CAT) --output "$@" "$<" $(filter %.xml,$^)
826 $(call MSG_L1,Fresh ChangeLog.html is now at $@)
827
828cl-html:: $(VBOX_PATH_MANUAL_OUTBASE)/en_US/ChangeLog.html
829
830
831
832endif # if defined(VBOX_WITH_DOCS) && (!defined(VBOX_ONLY_BUILD) || defined(VBOX_ONLY_DOCS) || defined(VBOX_ONLY_SDK))
833
834
835#
836# VBoxManage man pages (parts also required by VBoxManage built-in help).
837#
838
839##
840# Emits rules for preprocessing refentry sources (applying remarks element),
841# and for producing the actual man pages.
842# $(evalcall2 def_vbox_refentry_to_manpage)
843# @param 1 The language
844# @param 2 The file name (no path).
845define def_vbox_refentry_to_manpage
846$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2): \
847 $$(VBOX_PATH_MANUAL_SRC)/$(1)/$(2) \
848 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
849 $$(VBOX_XML_XREF_TO_TEXT) \
850 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
851 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
852 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
853 $$(QUIET)$$(RM) -f "$$@"
854 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
855 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
856 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@.tmp $$(VBOX_XML_XREF_TO_TEXT) $$@
857 $$(QUIET)$$(MV) -f -- "$$@.tmp" "$$@"
858if defined(VBOX_HAVE_XMLLINT)
859 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
860endif
861
862$$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(patsubst man_%,%.1,$(basename $(2))): \
863 $$(VBOX_PATH_MANUAL_OUTBASE)/$(1)/$(2) \
864 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl \
865 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $$(VBOX_XML_CATALOG_MANUAL) \
866 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
867 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
868 $$(QUIET)$$(RM) -f "$$@"
869 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage.xsl $$<
870endef
871$(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
872, $(evalcall2 def_vbox_refentry_to_manpage,$(lang),$(file))))
873
874
875# Handy aliases.
876validate-manpages:: $(addprefix $(VBOX_PATH_MANUAL_OUTBASE)/en_US/,$(VBOX_MANUAL_XML_REFENTRY_FILES))
877man-experiment:: $(foreach lang,$(VBOX_MANUAL_LANGUAGES),$(foreach file,$(VBOX_MANUAL_XML_REFENTRY_FILES) \
878 ,$$(VBOX_PATH_MANUAL_OUTBASE)/$(lang)/$(patsubst man_%,%.1,$(basename $(file)))))
879
880
881
882include $(FILE_KBUILD_SUB_FOOTER)
883
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette