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