VirtualBox

source: vbox/trunk/doc/manual/Config.kmk@ 72949

Last change on this file since 72949 was 72949, checked in by vboxsync, 7 years ago

VBoxManage,manual: Added a new command called 'mediumio' to VBoxManage for making use of the IMediumIO interface.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.9 KB
Line 
1# $Id: Config.kmk 72949 2018-07-07 16:22:45Z vboxsync $
2## @file
3# kBuild Configuration file for the manual.
4#
5
6#
7# Copyright (C) 2010-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
18ifndef VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED
19VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED = 1
20
21# Include the top-level configure file.
22ifndef VBOX_ROOT_CONFIG_KMK_INCLUDED
23 include $(PATH_ROOT)/Config.kmk
24endif
25
26
27#
28# Globals.
29#
30
31# Source location.
32VBOX_PATH_MANUAL_SRC := $(PATH_ROOT)/doc/manual
33# Output location.
34VBOX_PATH_MANUAL_OUTBASE := $(PATH_OBJ)/manual
35
36## List of refentry files (manpages).
37VBOX_MANUAL_XML_REFENTRY_FILES := \
38 man_VBoxManage-mediumio.xml \
39 man_VBoxManage-debugvm.xml \
40 man_VBoxManage-extpack.xml \
41 man_VBoxManage-unattended.xml
42
43
44# Tool locations.
45ifndef VBOX_OSE
46 # use docbook from our tools directory
47 VBOX_PATH_DOCBOOK ?= $(PATH_DEVTOOLS)/common/DocBook/v1.69.1
48 VBOX_PATH_DOCBOOK_DTD ?= $(PATH_DEVTOOLS)/common/docbook-xml/v4.3
49 VBOX_XML_CATALOG ?= $(VBOX_PATH_MANUAL_OUTBASE)/catalog
50 VBOX_XML_CATALOG_DOCBOOK ?= $(VBOX_PATH_MANUAL_OUTBASE)/docbook
51else
52 # use docbook of the build host
53 VBOX_PATH_DOCBOOK ?= http://docbook.sourceforge.net/release/xsl/current/
54endif
55
56# xsltproc with the catalog trick if applicable.
57ifdef VBOX_XML_CATALOG
58 VBOX_XSLTPROC_WITH_CAT = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" $1 -- \
59 $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
60 VBOX_XMLLINT_WITH_CAT = $(REDIRECT) -E "XML_CATALOG_FILES=$(VBOX_XML_CATALOG)" -- \
61 $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
62else
63 VBOX_XSLTPROC_WITH_CAT = $(if $(1), $(REDIRECT) $1 --,) $(VBOX_XSLTPROC) --nonet --xinclude $(VBOX_XSLTPROC_OPTS)
64 VBOX_XMLLINT_WITH_CAT = $(VBOX_XMLLINT) --nonet --xinclude --noout $(VBOX_XMLLINT_OPTS)
65endif
66
67
68##
69# Non-pattern-rule approach to editing XSLT files.
70# $(evalcall2 def_vbox_replace_paths_in_xslt)
71# @param 1 The XSLT source file (relative to Makefile dir).
72# @param 2 Optional output subdirectory (leading slash).
73define def_vbox_replace_paths_in_xslt
74OTHER_CLEAN += $$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1)
75$$(VBOX_PATH_MANUAL_OUTBASE)$2/$(notdir $1): $$(VBOX_PATH_MANUAL_SRC)/$1 | $$$$(dir $$$$@)
76 $$(call MSG_L1,Pre-processing $$(<) to $$(@))
77 $$(QUIET)$$(SED) \
78 -e 's|@VBOX_PATH_DOCBOOK@|$$(VBOX_PATH_DOCBOOK)|g' \
79 -e 's|@VBOX_PATH_MANUAL_SRC@|$$(VBOX_PATH_MANUAL_SRC)|g' \
80 -e 's|@VBOX_PATH_MANUAL_OUTBASE@|$$(VBOX_PATH_MANUAL_OUTBASE)|g' \
81 -e 's|@VBOX_PATH_MANUAL_OUT_LANG@|$$(VBOX_PATH_MANUAL_OUTBASE)$2|g' \
82 --output "$$(@)" $$<
83endef
84
85
86##
87# Emits rules for preprocessing refentry sources (applying remarks element),
88# and for producing the actual man pages.
89#
90# $(evalcall2 def_vbox_refentry_to_manpage)
91# @param 1 The output directory.
92# @param 2 The XML file name (no path).
93# @param 3 The XML file with full path.
94define def_vbox_refentry_preprocess_for_manpage
95$(1)/$(2): \
96 $(3) \
97 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl \
98 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) \
99 $$(VBOX_VERSION_STAMP) | $$$$(dir $$$$@)
100 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(firstword $$(filter %.xml,$$^)),$$@)
101 $$(QUIET)$$(RM) -f "$$@"
102 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT) --output $$@ \
103 $$(VBOX_PATH_MANUAL_SRC)/docbook-refentry-to-manpage-preprocessing.xsl $$<
104if defined(VBOX_HAVE_XMLLINT) && "$(USER)" == "bird" # Effing stuff happends on build servers, probably kmk related...
105 $$(VBOX_XMLLINT_WITH_CAT) --dtdvalid $$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd $$@
106endif
107endef
108
109##
110# Generate a single header file containing everything (no C file).
111#
112# @param 1 Destination file.
113# @param 2 Full source file path.
114# @param 3 Help infix.
115define def_vbox_single_refentry_to_h
116$(1).ts +| $(1): \
117 $$(VBOX_DOCBOOK_REFENTRY_TO_C_HELP) \
118 $$(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) \
119 $(2) \
120 $$(VBOX_XML_CATALOG) $$(VBOX_XML_CATALOG_DOCBOOK) $(MAKEFILE) | $$$$(dir $$$$@)
121 $$(call MSG_TOOL,xsltproc $$(notdir $$(firstword $$(filter %.xsl,$$^))),,$$(filter %.xml,$$^),$$(patsubst %.ts,%,$$@))
122 $$(QUIET)$$(APPEND) -tn "$$@" \
123 '/* Autogenerated by $$(notdir $$(filter %.xsl,$$^)), do not edit! */' \
124 '' \
125 '#include <iprt/message.h>' \
126 '' \
127 'typedef enum HELP_CMD_$(3)' \
128 '{' \
129 ' HELP_CMD_INVALID = 0,'
130 $$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$$@") \
131 --stringparam 'g_sMode' 'cmd' $$(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) $(2)
132 $$(QUIET)$$(APPEND) -n "$$@" \
133 ' HELP_CMD_END' \
134 '} HELP_CMD_VBOXMANAGE;' \
135 ''
136 $$(NLTAB)$$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$$@") \
137 --stringparam 'g_sMode' 'subcmd' $$(VBOX_DOCBOOK_REFENTRY_TO_H_HELP) $(2)
138 $$(QUIET)$$(APPEND) -n "$$@" \
139 ''
140 $$(NLTAB)$$(QUIET)$$(call VBOX_XSLTPROC_WITH_CAT, -a+to "$$@") $$(VBOX_DOCBOOK_REFENTRY_TO_C_HELP) $(2)
141 $$(QUIET)$$(APPEND) -n "$$@" \
142 '' \
143 '/* end of file */'
144 $$(QUIET)$$(CP) --changed -- "$$@" "$$(patsubst %.ts,%,$$@)"
145endef
146
147
148#
149# Make sure we've got a rule to make the output directory.
150#
151BLDDIRS += $(VBOX_PATH_MANUAL_OUTBASE)
152
153
154ifdef VBOX_XML_CATALOG
155 #
156 # To avoid network I/O for fetching DTDs, we generate catalogs mapping the public
157 # entity IDs to local files. (Obviously, only done when we have local files.)
158 #
159 # Create a catalog file for xsltproc that points to docbook catalog.
160 $(VBOX_XML_CATALOG): $(MAKEFILE_CURRENT) | $$(dir $$@)
161 $(call MSG_L1,Creating catalog $@)
162 $(QUIET)$(APPEND) -tn "$@" \
163 '<?xml version="1.0"?>' \
164 '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">' \
165 '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">' \
166 ' <delegatePublic publicIdStartString="-//OASIS/ENTITIES DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>' \
167 ' <delegatePublic publicIdStartString="-//OASIS/DTD DocBook XML" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>' \
168 ' <delegateSystem systemIdStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>' \
169 ' <delegateURI uriStartString="http://www.oasis-open.org/docbook/" catalog="file:///$(VBOX_XML_CATALOG_DOCBOOK)"/>' \
170 '</catalog>'
171
172 # Create a docbook catalog file for xsltproc that points to the local docbook files.
173 $(VBOX_XML_CATALOG_DOCBOOK): $(MAKEFILE_CURRENT) | $$(dir $$@)
174 $(call MSG_L1,Creating catalog $@)
175 $(QUIET)$(APPEND) -tn "$@" \
176 '<?xml version="1.0"?>' \
177 '<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">' \
178 '<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">' \
179 ' <public publicId="-//OASIS//ELEMENTS DocBook XML Information Pool V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbpoolx.mod"/>' \
180 ' <public publicId="-//OASIS//DTD DocBook XML V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/docbookx.dtd"/>' \
181 ' <public publicId="-//OASIS//ENTITIES DocBook XML Character Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbcentx.mod"/>' \
182 ' <public publicId="-//OASIS//ENTITIES DocBook XML Notations V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbnotnx.mod"/>' \
183 ' <public publicId="-//OASIS//ENTITIES DocBook XML Additional General Entities V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbgenent.mod"/>' \
184 ' <public publicId="-//OASIS//ELEMENTS DocBook XML Document Hierarchy V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/dbhierx.mod"/>' \
185 ' <public publicId="-//OASIS//DTD XML Exchange Table Model 19990315//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/soextblx.dtd"/>' \
186 ' <public publicId="-//OASIS//DTD DocBook XML CALS Table Model V4.3//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/calstblx.dtd"/>' \
187 ' <rewriteSystem systemIdStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>' \
188 ' <rewriteURI uriStartString="http://www.oasis-open.org/docbook/xml/4.3" rewritePrefix="file:///$(VBOX_PATH_DOCBOOK_DTD)"/>' \
189 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Arrow Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsa.ent"/>' \
190 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Binary Operators//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsb.ent"/>' \
191 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Delimiters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsc.ent"/>' \
192 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Negated Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsn.ent"/>' \
193 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Ordinary//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amso.ent"/>' \
194 ' <public publicId="ISO 8879:1986//ENTITIES Added Math Symbols: Relations//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-amsr.ent"/>' \
195 ' <public publicId="ISO 8879:1986//ENTITIES Box and Line Drawing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-box.ent"/>' \
196 ' <public publicId="ISO 8879:1986//ENTITIES Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr1.ent"/>' \
197 ' <public publicId="ISO 8879:1986//ENTITIES Non-Russian Cyrillic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-cyr2.ent"/>' \
198 ' <public publicId="ISO 8879:1986//ENTITIES Diacritical Marks//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-dia.ent"/>' \
199 ' <public publicId="ISO 8879:1986//ENTITIES Greek Letters//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk1.ent"/>' \
200 ' <public publicId="ISO 8879:1986//ENTITIES Monotoniko Greek//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk2.ent"/>' \
201 ' <public publicId="ISO 8879:1986//ENTITIES Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk3.ent"/>' \
202 ' <public publicId="ISO 8879:1986//ENTITIES Alternative Greek Symbols//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-grk4.ent"/>' \
203 ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 1//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat1.ent"/>' \
204 ' <public publicId="ISO 8879:1986//ENTITIES Added Latin 2//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-lat2.ent"/>' \
205 ' <public publicId="ISO 8879:1986//ENTITIES Numeric and Special Graphic//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-num.ent"/>' \
206 ' <public publicId="ISO 8879:1986//ENTITIES Publishing//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-pub.ent"/>' \
207 ' <public publicId="ISO 8879:1986//ENTITIES General Technical//EN" uri="file:///$(VBOX_PATH_DOCBOOK_DTD)/ent/iso-tech.ent"/>' \
208 '</catalog>'
209
210endif # VBOX_XML_CATALOG
211
212
213#
214# Generate rules for editing the refentry to C/H style sheets.
215#
216$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-C-help.xsl,)
217VBOX_DOCBOOK_REFENTRY_TO_C_HELP = $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl
218
219$(evalcall2 def_vbox_replace_paths_in_xslt,docbook-refentry-to-H-help.xsl,)
220VBOX_DOCBOOK_REFENTRY_TO_H_HELP = $(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-H-help.xsl
221
222#
223# Manual dependency.
224#
225$(VBOX_PATH_MANUAL_OUTBASE)/docbook-refentry-to-C-help.xsl: $(VBOX_PATH_MANUAL_SRC)/common-formatcfg.xsl
226
227
228endif # !defined(VBOX_DOC_MANUAL_CONFIG_KMK_INCLUDED)
229
Note: See TracBrowser for help on using the repository browser.

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