1 | <?xml version="1.0"?>
|
---|
2 |
|
---|
3 | <!--
|
---|
4 | apiwrap-server-filelist.xsl:
|
---|
5 |
|
---|
6 | XSLT stylesheet that generate a makefile include with
|
---|
7 | the lists of files that apiwrap-server.xsl produces
|
---|
8 | from VirtualBox.xidl.
|
---|
9 | -->
|
---|
10 | <!--
|
---|
11 | Copyright (C) 2015-2023 Oracle and/or its affiliates.
|
---|
12 |
|
---|
13 | This file is part of VirtualBox base platform packages, as
|
---|
14 | available from https://www.virtualbox.org.
|
---|
15 |
|
---|
16 | This program is free software; you can redistribute it and/or
|
---|
17 | modify it under the terms of the GNU General Public License
|
---|
18 | as published by the Free Software Foundation, in version 3 of the
|
---|
19 | License.
|
---|
20 |
|
---|
21 | This program is distributed in the hope that it will be useful, but
|
---|
22 | WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
24 | General Public License for more details.
|
---|
25 |
|
---|
26 | You should have received a copy of the GNU General Public License
|
---|
27 | along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
28 |
|
---|
29 | SPDX-License-Identifier: GPL-3.0-only
|
---|
30 | -->
|
---|
31 |
|
---|
32 | <xsl:stylesheet
|
---|
33 | version="1.0"
|
---|
34 | xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
---|
35 | xmlns:exsl="http://exslt.org/common"
|
---|
36 | extension-element-prefixes="exsl">
|
---|
37 |
|
---|
38 | <xsl:output method="text"/>
|
---|
39 |
|
---|
40 | <xsl:strip-space elements="*"/>
|
---|
41 |
|
---|
42 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
43 | XSLT parameters
|
---|
44 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
45 |
|
---|
46 | <!-- Whether to generate wrappers for VBoxSDS-->
|
---|
47 | <xsl:param name="g_fVBoxWithSDS" select="'no'"/>
|
---|
48 |
|
---|
49 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
50 | global XSLT variables
|
---|
51 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
52 |
|
---|
53 | <xsl:variable name="G_sNewLine">
|
---|
54 | <xsl:choose>
|
---|
55 | <xsl:when test="$KBUILD_HOST = 'win'">
|
---|
56 | <xsl:value-of select="' '"/>
|
---|
57 | </xsl:when>
|
---|
58 | <xsl:otherwise>
|
---|
59 | <xsl:value-of select="' '"/>
|
---|
60 | </xsl:otherwise>
|
---|
61 | </xsl:choose>
|
---|
62 | </xsl:variable>
|
---|
63 |
|
---|
64 |
|
---|
65 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
66 | wildcard match, ignore everything which has no explicit match
|
---|
67 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
68 |
|
---|
69 | <xsl:template match="*" mode="filelist-even-sources"/>
|
---|
70 | <xsl:template match="*" mode="filelist-odd-sources"/>
|
---|
71 | <xsl:template match="*" mode="filelist-headers"/>
|
---|
72 |
|
---|
73 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
74 | interface match
|
---|
75 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
76 |
|
---|
77 | <xsl:template match="interface" mode="filelist-even-sources">
|
---|
78 | <xsl:if test="not(@internal='yes') and not(@autogen='VBoxEvent') and not(@supportsErrorInfo='no') and (position() mod 2) = 0">
|
---|
79 | <xsl:value-of select="concat(' \', $G_sNewLine, '	$(VBOX_MAIN_APIWRAPPER_DIR)/', substring(@name, 2), 'Wrap.cpp')"/>
|
---|
80 | </xsl:if>
|
---|
81 | </xsl:template>
|
---|
82 |
|
---|
83 | <xsl:template match="interface" mode="filelist-odd-sources">
|
---|
84 | <xsl:if test="not(@internal='yes') and not(@autogen='VBoxEvent') and not(@supportsErrorInfo='no') and (position() mod 2) = 1">
|
---|
85 | <xsl:value-of select="concat(' \', $G_sNewLine, '	$(VBOX_MAIN_APIWRAPPER_DIR)/', substring(@name, 2), 'Wrap.cpp')"/>
|
---|
86 | </xsl:if>
|
---|
87 | </xsl:template>
|
---|
88 |
|
---|
89 | <xsl:template match="interface" mode="filelist-headers">
|
---|
90 | <xsl:if test="not(@internal='yes') and not(@autogen='VBoxEvent') and not(@supportsErrorInfo='no')">
|
---|
91 | <xsl:value-of select="concat(' \', $G_sNewLine, '	$(VBOX_MAIN_APIWRAPPER_DIR)/', substring(@name, 2), 'Wrap.h')"/>
|
---|
92 | </xsl:if>
|
---|
93 | </xsl:template>
|
---|
94 |
|
---|
95 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
96 | ignore all if tags except those for XPIDL or MIDL target
|
---|
97 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
98 |
|
---|
99 | <xsl:template match="if" mode="filelist-even-sources">
|
---|
100 | <xsl:if test="(@target = 'xpidl') or (@target = 'midl')">
|
---|
101 | <xsl:apply-templates mode="filelist-even-sources"/>
|
---|
102 | </xsl:if>
|
---|
103 | </xsl:template>
|
---|
104 |
|
---|
105 | <xsl:template match="if" mode="filelist-odd-sources">
|
---|
106 | <xsl:if test="(@target = 'xpidl') or (@target = 'midl')">
|
---|
107 | <xsl:apply-templates mode="filelist-odd-sources"/>
|
---|
108 | </xsl:if>
|
---|
109 | </xsl:template>
|
---|
110 |
|
---|
111 | <xsl:template match="if" mode="filelist-headers">
|
---|
112 | <xsl:if test="(@target = 'xpidl') or (@target = 'midl')">
|
---|
113 | <xsl:apply-templates mode="filelist-headers"/>
|
---|
114 | </xsl:if>
|
---|
115 | </xsl:template>
|
---|
116 |
|
---|
117 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
118 | application match
|
---|
119 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
120 |
|
---|
121 | <xsl:template match="application" mode="filelist-even-sources" name="template_app_filelist_even_sources">
|
---|
122 | <xsl:apply-templates mode="filelist-even-sources"/>
|
---|
123 | </xsl:template>
|
---|
124 |
|
---|
125 | <xsl:template match="application" mode="filelist-odd-sources" name="template_app_filelist_odd_sources">
|
---|
126 | <xsl:apply-templates mode="filelist-odd-sources"/>
|
---|
127 | </xsl:template>
|
---|
128 |
|
---|
129 | <xsl:template match="application" mode="filelist-headers" name="template_app_filelist_headers">
|
---|
130 | <xsl:apply-templates mode="filelist-headers"/>
|
---|
131 | </xsl:template>
|
---|
132 |
|
---|
133 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
134 | library match
|
---|
135 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
136 |
|
---|
137 | <xsl:template match="library" mode="filelist-even-sources">
|
---|
138 | <xsl:apply-templates mode="filelist-even-sources"/>
|
---|
139 | </xsl:template>
|
---|
140 |
|
---|
141 | <xsl:template match="library" mode="filelist-odd-sources">
|
---|
142 | <xsl:apply-templates mode="filelist-odd-sources"/>
|
---|
143 | </xsl:template>
|
---|
144 |
|
---|
145 | <xsl:template match="library" mode="filelist-headers">
|
---|
146 | <xsl:apply-templates mode="filelist-headers"/>
|
---|
147 | </xsl:template>
|
---|
148 |
|
---|
149 | <!-- - - - - - - - - - - - - - - - - - - - - - -
|
---|
150 | root match
|
---|
151 | - - - - - - - - - - - - - - - - - - - - - - -->
|
---|
152 |
|
---|
153 | <xsl:template match="/idl">
|
---|
154 | <xsl:text>VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN := </xsl:text>
|
---|
155 | <xsl:apply-templates mode="filelist-even-sources"/>
|
---|
156 | <xsl:value-of select="concat($G_sNewLine, $G_sNewLine)"/>
|
---|
157 |
|
---|
158 | <xsl:text>VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD := </xsl:text>
|
---|
159 | <xsl:apply-templates mode="filelist-odd-sources"/>
|
---|
160 | <xsl:value-of select="concat($G_sNewLine, $G_sNewLine)"/>
|
---|
161 |
|
---|
162 | <xsl:text>VBOX_MAIN_APIWRAPPER_GEN_SRCS := $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN) $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD)</xsl:text>
|
---|
163 | <xsl:value-of select="concat($G_sNewLine, $G_sNewLine)"/>
|
---|
164 |
|
---|
165 | <xsl:text>VBOX_MAIN_APIWRAPPER_GEN_HDRS := </xsl:text>
|
---|
166 | <xsl:apply-templates mode="filelist-headers"/>
|
---|
167 | <xsl:value-of select="concat($G_sNewLine, $G_sNewLine)"/>
|
---|
168 | </xsl:template>
|
---|
169 |
|
---|
170 |
|
---|
171 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-even-sources" >
|
---|
172 | <xsl:if test="$g_fVBoxWithSDS='yes'" >
|
---|
173 | <xsl:call-template name="template_app_filelist_even_sources" />
|
---|
174 | </xsl:if>
|
---|
175 | </xsl:template>
|
---|
176 |
|
---|
177 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-headers" >
|
---|
178 | <xsl:if test="$g_fVBoxWithSDS='yes'" >
|
---|
179 | <xsl:call-template name="template_app_filelist_headers" />
|
---|
180 | </xsl:if>
|
---|
181 | </xsl:template>
|
---|
182 |
|
---|
183 | <xsl:template match="application[@uuid='ec0e78e8-fa43-43e8-ac0a-02c784c4a4fa']" mode="filelist-odd-sources" >
|
---|
184 | <xsl:if test="$g_fVBoxWithSDS='yes'" >
|
---|
185 | <xsl:call-template name="template_app_filelist_odd_sources" />
|
---|
186 | </xsl:if>
|
---|
187 | </xsl:template>
|
---|
188 |
|
---|
189 |
|
---|
190 | </xsl:stylesheet>
|
---|
191 | <!-- vi: set tabstop=4 shiftwidth=4 expandtab: -->
|
---|
192 |
|
---|