1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/uwproj.xsd Thu Oct 12 00:00:35 2023 +0200 1.3 @@ -0,0 +1,281 @@ 1.4 +<?xml version="1.0" encoding="UTF-8"?> 1.5 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 1.6 + xmlns="http://unixwork.de/uwproj" 1.7 + targetNamespace="http://unixwork.de/uwproj" 1.8 + elementFormDefault="qualified" 1.9 + version="0.1" 1.10 +> 1.11 + <xs:element name="project" type="ProjectType"/> 1.12 + 1.13 + <xs:complexType name="ProjectType"> 1.14 + <xs:annotation> 1.15 + <xs:documentation> 1.16 + The root element of an uwproj project. 1.17 + Consists of an optional <code>config</code> element 1.18 + and an arbitrary number of <code>dependency</code> 1.19 + and <code>target</code> elements. 1.20 + </xs:documentation> 1.21 + </xs:annotation> 1.22 + <xs:sequence> 1.23 + <xs:element name="config" type="ConfigType" minOccurs="0"/> 1.24 + <xs:element name="dependency" type="DependencyType" minOccurs="0" maxOccurs="unbounded"/> 1.25 + <xs:element name="target" type="TargetType" minOccurs="0" maxOccurs="unbounded"/> 1.26 + </xs:sequence> 1.27 + </xs:complexType> 1.28 + 1.29 + <xs:complexType name="ConfigType"> 1.30 + <xs:annotation> 1.31 + <xs:documentation> 1.32 + The configuration section. 1.33 + Consists of an arbitrary number of <code>var</code> elements. 1.34 + </xs:documentation> 1.35 + </xs:annotation> 1.36 + <xs:sequence> 1.37 + <xs:element name="var" type="ConfigVarType" minOccurs="0" maxOccurs="unbounded"/> 1.38 + </xs:sequence> 1.39 + </xs:complexType> 1.40 + 1.41 + <xs:complexType name="ConfigVarType"> 1.42 + <xs:annotation> 1.43 + <xs:documentation> 1.44 + The definition of a configuration variable. 1.45 + <p> 1.46 + Configuration variables are supposed to be used in the configure script and are also 1.47 + written to the resulting config file (in contrast to make variables, which are only 1.48 + written to the config file). 1.49 + The <code>name</code> attribute is mandatory, the value is defined by the text body of the element. 1.50 + The optional Boolean <code>exec</code> attribute (false by default) controls, whether the entire 1.51 + definition is automatically executed under command substitution. 1.52 + </p> 1.53 + </xs:documentation> 1.54 + </xs:annotation> 1.55 + <xs:simpleContent> 1.56 + <xs:extension base="xs:string"> 1.57 + <xs:attribute name="name" type="xs:string" use="required"/> 1.58 + <xs:attribute name="exec" type="xs:boolean" default="false"/> 1.59 + </xs:extension> 1.60 + </xs:simpleContent> 1.61 + </xs:complexType> 1.62 + 1.63 + <xs:complexType name="PkgConfigType"> 1.64 + <xs:annotation> 1.65 + <xs:documentation> 1.66 + Instructs configure to invoke <code>pkg-config</code>, if present on the system, to determine 1.67 + compiler and linker flags. The text body of this element defines the package name to search. 1.68 + To constrain the allowed versions, use the attributes <code>atleast, exact, max</code>. 1.69 + </xs:documentation> 1.70 + </xs:annotation> 1.71 + <xs:simpleContent> 1.72 + <xs:extension base="xs:string"> 1.73 + <xs:attribute name="atleast" type="xs:string"/> 1.74 + <xs:attribute name="exact" type="xs:string"/> 1.75 + <xs:attribute name="max" type="xs:string"/> 1.76 + </xs:extension> 1.77 + </xs:simpleContent> 1.78 + </xs:complexType> 1.79 + 1.80 + <xs:simpleType name="LangType"> 1.81 + <xs:annotation> 1.82 + <xs:documentation> 1.83 + Requests a compiler for the specified language. Allowed values are 1.84 + c, cpp. 1.85 + </xs:documentation> 1.86 + </xs:annotation> 1.87 + <xs:restriction base="xs:string"> 1.88 + <xs:enumeration value="c"/> 1.89 + <xs:enumeration value="cpp"/> 1.90 + </xs:restriction> 1.91 + </xs:simpleType> 1.92 + 1.93 + <xs:complexType name="DependencyType"> 1.94 + <xs:annotation> 1.95 + <xs:documentation> 1.96 + Declares a dependency. 1.97 + <p> 1.98 + If the optional <code>name</code> attribute is omitted, the dependency is global 1.99 + and must be satisfied, otherwise configuration shall fail. 1.100 + A <em>named dependency</em> can be referenced by a target (or is implicitly referenced 1.101 + by the default target, if no targets are specified). 1.102 + Multiple declarations for the same named dependency may exist, in which case each declaration 1.103 + is checked one after another, until one block is satisfied. The result of the first satisfied 1.104 + dependency declaration is supposed to be applied to the config file. 1.105 + </p> 1.106 + <p> 1.107 + The optional <code>platform</code> attribute may specify a <em>single</em> platform identifier and 1.108 + the optional <code>not</code> attribute may specify a comma-separated list of platform identifiers. 1.109 + The configure script shall skip this dependency declaration if the detected platform is not 1.110 + matching the filter specification of these attributes. 1.111 + </p> 1.112 + </xs:documentation> 1.113 + </xs:annotation> 1.114 + <xs:choice minOccurs="0" maxOccurs="unbounded"> 1.115 + <xs:element name="lang" type="LangType"/> 1.116 + <xs:element name="cflags" type="FlagsType"/> 1.117 + <xs:element name="cxxflags" type="FlagsType"/> 1.118 + <xs:element name="ldflags" type="FlagsType"/> 1.119 + <xs:element name="pkgconfig" type="PkgConfigType"/> 1.120 + <xs:element name="test" type="xs:string"> 1.121 + <xs:annotation> 1.122 + <xs:documentation> 1.123 + Specifies a custom command that shall be executed to test whether this dependency is satisfied. 1.124 + </xs:documentation> 1.125 + </xs:annotation> 1.126 + </xs:element> 1.127 + <xs:element name="make" type="MakeVarType"/> 1.128 + </xs:choice> 1.129 + <xs:attribute name="name" type="xs:string"/> 1.130 + <xs:attribute name="platform" type="xs:string"/> 1.131 + <xs:attribute name="not" type="xs:string"/> 1.132 + </xs:complexType> 1.133 + 1.134 + <xs:complexType name="FlagsType"> 1.135 + <xs:annotation> 1.136 + <xs:documentation> 1.137 + Instructs configure to append the contents of the element's body to the respective flags variable. 1.138 + If the optional <code>exec</code> flag is set to <code>true</code>, the contents are supposed to be 1.139 + executed under command substitution <em>at configuration time</em> before they are applied. 1.140 + </xs:documentation> 1.141 + </xs:annotation> 1.142 + <xs:simpleContent> 1.143 + <xs:extension base="xs:string"> 1.144 + <xs:attribute name="exec" type="xs:boolean" default="false"/> 1.145 + </xs:extension> 1.146 + </xs:simpleContent> 1.147 + </xs:complexType> 1.148 + 1.149 + <xs:complexType name="TargetType"> 1.150 + <xs:annotation> 1.151 + <xs:documentation> 1.152 + Declares a build target that is supposed to be configured. 1.153 + <p> 1.154 + If no build target is declared explicitly, an implicit default 1.155 + target is generated, which has the <code>alldependencies</code> 1.156 + flag set. 1.157 + </p> 1.158 + <p> 1.159 + The optional <code>name</code> attribute is also used to generate a prefix 1.160 + for the compiler and linker flags variables. 1.161 + Furthermore, a target may consist of an arbitrary number of <code>feature</code>, 1.162 + <code>option</code>, and <code>define</code> elements. 1.163 + Named dependencies can be listed (separated by comma) in the <code>dependencies</code> 1.164 + element. If this target shall use <em>all</em> available named dependencies, the empty 1.165 + element <code>alldependencies</code> can be used as a shortcut. 1.166 + </p> 1.167 + </xs:documentation> 1.168 + </xs:annotation> 1.169 + <xs:choice minOccurs="0" maxOccurs="unbounded"> 1.170 + <xs:element name="feature" type="FeatureType"/> 1.171 + <xs:element name="option" type="OptionType"/> 1.172 + <xs:element name="define" type="DefineType"/> 1.173 + <xs:element name="dependencies" type="DependenciesType"/> 1.174 + <xs:element name="alldependencies"> 1.175 + <xs:complexType/> 1.176 + </xs:element> 1.177 + </xs:choice> 1.178 + <xs:attribute name="name" type="xs:string"/> 1.179 + </xs:complexType> 1.180 + 1.181 + <xs:complexType name="FeatureType"> 1.182 + <xs:annotation> 1.183 + <xs:documentation> 1.184 + Declares an optional feature, that can be enabled during configuration, if all 1.185 + <code>dependencies</code> are satisfied. 1.186 + If a feature is enabled, all <code>define</code> and <code>make</code> definitions are 1.187 + supposed to be applied to the config file. 1.188 + In case the optional <code>default</code> attribute is set to true, the feature is enabled by default 1.189 + and is supposed to be automatically disabled (without error) when the dependencies are not satisfied. 1.190 + The name that is supposed to be used for the --enable and --disable arguments can be optionally 1.191 + specified with the <code>arg</code> attribute. Otherwise, the <code>name</code> is used by default. 1.192 + </xs:documentation> 1.193 + </xs:annotation> 1.194 + <xs:choice minOccurs="0" maxOccurs="unbounded"> 1.195 + <xs:group ref="TargetDataGroup"/> 1.196 + </xs:choice> 1.197 + <xs:attribute name="name" type="xs:string" use="required"/> 1.198 + <xs:attribute name="arg" type="xs:string"/> 1.199 + <xs:attribute name="default" type="xs:boolean" default="false"/> 1.200 + </xs:complexType> 1.201 + 1.202 + <xs:complexType name="OptionType"> 1.203 + <xs:annotation> 1.204 + <xs:documentation> 1.205 + Declares a configuration option. 1.206 + The option argument name is specified with the <code>arg</code> attribute. 1.207 + Then, the children of this element specify possible <code>values</code> by defining the conditions 1.208 + (in terms of dependencies) and effects (in terms of defines and make variables) of each value. 1.209 + Finally, a set of <code>default</code>s is specified which supposed to automagically select the most 1.210 + appropriate value for a specific platform under the available dependencies (in case the option is not 1.211 + explicitly specified by using the command line argument). 1.212 + </xs:documentation> 1.213 + </xs:annotation> 1.214 + <xs:sequence> 1.215 + <xs:element name="value" type="OptionValueType" minOccurs="0" maxOccurs="unbounded"/> 1.216 + <xs:element name="default" type="OptionDefaultType" minOccurs="0" maxOccurs="unbounded"/> 1.217 + </xs:sequence> 1.218 + <xs:attribute name="arg" type="xs:string" use="required"/> 1.219 + </xs:complexType> 1.220 + 1.221 + <xs:complexType name="OptionValueType"> 1.222 + <xs:annotation> 1.223 + <xs:documentation> 1.224 + Declares a possible value for the option (in the <code>str</code> attribute) and 1.225 + the conditions (<code>dependencies</code>) and effects, the value has. 1.226 + </xs:documentation> 1.227 + </xs:annotation> 1.228 + <xs:choice minOccurs="0" maxOccurs="unbounded"> 1.229 + <xs:group ref="TargetDataGroup"/> 1.230 + </xs:choice> 1.231 + <xs:attribute name="str" type="xs:string" use="required"/> 1.232 + </xs:complexType> 1.233 + 1.234 + <xs:complexType name="OptionDefaultType"> 1.235 + <xs:annotation> 1.236 + <xs:documentation> 1.237 + Specifies a default value for this option. Multiple default values can be specified, in which case 1.238 + they are checked one after another for availability. With the optional <code>platform</code> attribute, 1.239 + the default value can be constrained to a <em>single</em> specific platform and is supposed to be 1.240 + skipped by configure, when this platform is not detected. 1.241 + </xs:documentation> 1.242 + </xs:annotation> 1.243 + <xs:attribute name="value" type="xs:string" use="required"/> 1.244 + <xs:attribute name="platform" type="xs:string"/> 1.245 + </xs:complexType> 1.246 + 1.247 + <xs:group name="TargetDataGroup"> 1.248 + <xs:choice> 1.249 + <xs:element name="define" type="DefineType" minOccurs="0" maxOccurs="unbounded"/> 1.250 + <xs:element name="dependencies" type="DependenciesType" minOccurs="0" maxOccurs="unbounded"/> 1.251 + <xs:element name="make" type="MakeVarType" minOccurs="0" maxOccurs="unbounded"/> 1.252 + </xs:choice> 1.253 + </xs:group> 1.254 + 1.255 + <xs:complexType name="DefineType"> 1.256 + <xs:annotation> 1.257 + <xs:documentation> 1.258 + Specifies C/C++ pre-processor definitions that are supposed to 1.259 + be appended to the compiler flags, if supported. 1.260 + (Note: for example, Fortran also supports C/C++ style pre-processor definitions under 1.261 + certain circumstances) 1.262 + </xs:documentation> 1.263 + </xs:annotation> 1.264 + <xs:attribute name="name" type="xs:string" use="required"/> 1.265 + <xs:attribute name="value" type="xs:string"/> 1.266 + </xs:complexType> 1.267 + 1.268 + <xs:simpleType name="DependenciesType"> 1.269 + <xs:annotation> 1.270 + <xs:documentation>A comma-separated list of named dependencies.</xs:documentation> 1.271 + </xs:annotation> 1.272 + <xs:restriction base="xs:string"/> 1.273 + </xs:simpleType> 1.274 + 1.275 + <xs:simpleType name="MakeVarType"> 1.276 + <xs:annotation> 1.277 + <xs:documentation> 1.278 + The text contents in the body of this element are supposed to be appended literally 1.279 + to the config file without prior processing. 1.280 + </xs:documentation> 1.281 + </xs:annotation> 1.282 + <xs:restriction base="xs:string"/> 1.283 + </xs:simpleType> 1.284 +</xs:schema> 1.285 \ No newline at end of file