VirtualBox

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

Last change on this file since 76084 was 76078, checked in by vboxsync, 6 years ago

manual: integrate drop #30 with minimal manual adjustments (but everything into one book, with manually applied tweaks to turn the release notes into a pure changelog again and manually re-applied the last changelog change since it wasn't included yet)

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