make/uwproj.xsd

Thu, 12 Oct 2023 00:00:35 +0200

author
Mike Becker <universe@uap-core.de>
date
Thu, 12 Oct 2023 00:00:35 +0200
changeset 753
24dc84788dee
child 815
b0c4750cecd8
permissions
-rw-r--r--

replace most of the build system with uwproj

universe@753 1 <?xml version="1.0" encoding="UTF-8"?>
universe@753 2 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
universe@753 3 xmlns="http://unixwork.de/uwproj"
universe@753 4 targetNamespace="http://unixwork.de/uwproj"
universe@753 5 elementFormDefault="qualified"
universe@753 6 version="0.1"
universe@753 7 >
universe@753 8 <xs:element name="project" type="ProjectType"/>
universe@753 9
universe@753 10 <xs:complexType name="ProjectType">
universe@753 11 <xs:annotation>
universe@753 12 <xs:documentation>
universe@753 13 The root element of an uwproj project.
universe@753 14 Consists of an optional <code>config</code> element
universe@753 15 and an arbitrary number of <code>dependency</code>
universe@753 16 and <code>target</code> elements.
universe@753 17 </xs:documentation>
universe@753 18 </xs:annotation>
universe@753 19 <xs:sequence>
universe@753 20 <xs:element name="config" type="ConfigType" minOccurs="0"/>
universe@753 21 <xs:element name="dependency" type="DependencyType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 22 <xs:element name="target" type="TargetType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 23 </xs:sequence>
universe@753 24 </xs:complexType>
universe@753 25
universe@753 26 <xs:complexType name="ConfigType">
universe@753 27 <xs:annotation>
universe@753 28 <xs:documentation>
universe@753 29 The configuration section.
universe@753 30 Consists of an arbitrary number of <code>var</code> elements.
universe@753 31 </xs:documentation>
universe@753 32 </xs:annotation>
universe@753 33 <xs:sequence>
universe@753 34 <xs:element name="var" type="ConfigVarType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 35 </xs:sequence>
universe@753 36 </xs:complexType>
universe@753 37
universe@753 38 <xs:complexType name="ConfigVarType">
universe@753 39 <xs:annotation>
universe@753 40 <xs:documentation>
universe@753 41 The definition of a configuration variable.
universe@753 42 <p>
universe@753 43 Configuration variables are supposed to be used in the configure script and are also
universe@753 44 written to the resulting config file (in contrast to make variables, which are only
universe@753 45 written to the config file).
universe@753 46 The <code>name</code> attribute is mandatory, the value is defined by the text body of the element.
universe@753 47 The optional Boolean <code>exec</code> attribute (false by default) controls, whether the entire
universe@753 48 definition is automatically executed under command substitution.
universe@753 49 </p>
universe@753 50 </xs:documentation>
universe@753 51 </xs:annotation>
universe@753 52 <xs:simpleContent>
universe@753 53 <xs:extension base="xs:string">
universe@753 54 <xs:attribute name="name" type="xs:string" use="required"/>
universe@753 55 <xs:attribute name="exec" type="xs:boolean" default="false"/>
universe@753 56 </xs:extension>
universe@753 57 </xs:simpleContent>
universe@753 58 </xs:complexType>
universe@753 59
universe@753 60 <xs:complexType name="PkgConfigType">
universe@753 61 <xs:annotation>
universe@753 62 <xs:documentation>
universe@753 63 Instructs configure to invoke <code>pkg-config</code>, if present on the system, to determine
universe@753 64 compiler and linker flags. The text body of this element defines the package name to search.
universe@753 65 To constrain the allowed versions, use the attributes <code>atleast, exact, max</code>.
universe@753 66 </xs:documentation>
universe@753 67 </xs:annotation>
universe@753 68 <xs:simpleContent>
universe@753 69 <xs:extension base="xs:string">
universe@753 70 <xs:attribute name="atleast" type="xs:string"/>
universe@753 71 <xs:attribute name="exact" type="xs:string"/>
universe@753 72 <xs:attribute name="max" type="xs:string"/>
universe@753 73 </xs:extension>
universe@753 74 </xs:simpleContent>
universe@753 75 </xs:complexType>
universe@753 76
universe@753 77 <xs:simpleType name="LangType">
universe@753 78 <xs:annotation>
universe@753 79 <xs:documentation>
universe@753 80 Requests a compiler for the specified language. Allowed values are
universe@753 81 c, cpp.
universe@753 82 </xs:documentation>
universe@753 83 </xs:annotation>
universe@753 84 <xs:restriction base="xs:string">
universe@753 85 <xs:enumeration value="c"/>
universe@753 86 <xs:enumeration value="cpp"/>
universe@753 87 </xs:restriction>
universe@753 88 </xs:simpleType>
universe@753 89
universe@753 90 <xs:complexType name="DependencyType">
universe@753 91 <xs:annotation>
universe@753 92 <xs:documentation>
universe@753 93 Declares a dependency.
universe@753 94 <p>
universe@753 95 If the optional <code>name</code> attribute is omitted, the dependency is global
universe@753 96 and must be satisfied, otherwise configuration shall fail.
universe@753 97 A <em>named dependency</em> can be referenced by a target (or is implicitly referenced
universe@753 98 by the default target, if no targets are specified).
universe@753 99 Multiple declarations for the same named dependency may exist, in which case each declaration
universe@753 100 is checked one after another, until one block is satisfied. The result of the first satisfied
universe@753 101 dependency declaration is supposed to be applied to the config file.
universe@753 102 </p>
universe@753 103 <p>
universe@753 104 The optional <code>platform</code> attribute may specify a <em>single</em> platform identifier and
universe@753 105 the optional <code>not</code> attribute may specify a comma-separated list of platform identifiers.
universe@753 106 The configure script shall skip this dependency declaration if the detected platform is not
universe@753 107 matching the filter specification of these attributes.
universe@753 108 </p>
universe@753 109 </xs:documentation>
universe@753 110 </xs:annotation>
universe@753 111 <xs:choice minOccurs="0" maxOccurs="unbounded">
universe@753 112 <xs:element name="lang" type="LangType"/>
universe@753 113 <xs:element name="cflags" type="FlagsType"/>
universe@753 114 <xs:element name="cxxflags" type="FlagsType"/>
universe@753 115 <xs:element name="ldflags" type="FlagsType"/>
universe@753 116 <xs:element name="pkgconfig" type="PkgConfigType"/>
universe@753 117 <xs:element name="test" type="xs:string">
universe@753 118 <xs:annotation>
universe@753 119 <xs:documentation>
universe@753 120 Specifies a custom command that shall be executed to test whether this dependency is satisfied.
universe@753 121 </xs:documentation>
universe@753 122 </xs:annotation>
universe@753 123 </xs:element>
universe@753 124 <xs:element name="make" type="MakeVarType"/>
universe@753 125 </xs:choice>
universe@753 126 <xs:attribute name="name" type="xs:string"/>
universe@753 127 <xs:attribute name="platform" type="xs:string"/>
universe@753 128 <xs:attribute name="not" type="xs:string"/>
universe@753 129 </xs:complexType>
universe@753 130
universe@753 131 <xs:complexType name="FlagsType">
universe@753 132 <xs:annotation>
universe@753 133 <xs:documentation>
universe@753 134 Instructs configure to append the contents of the element's body to the respective flags variable.
universe@753 135 If the optional <code>exec</code> flag is set to <code>true</code>, the contents are supposed to be
universe@753 136 executed under command substitution <em>at configuration time</em> before they are applied.
universe@753 137 </xs:documentation>
universe@753 138 </xs:annotation>
universe@753 139 <xs:simpleContent>
universe@753 140 <xs:extension base="xs:string">
universe@753 141 <xs:attribute name="exec" type="xs:boolean" default="false"/>
universe@753 142 </xs:extension>
universe@753 143 </xs:simpleContent>
universe@753 144 </xs:complexType>
universe@753 145
universe@753 146 <xs:complexType name="TargetType">
universe@753 147 <xs:annotation>
universe@753 148 <xs:documentation>
universe@753 149 Declares a build target that is supposed to be configured.
universe@753 150 <p>
universe@753 151 If no build target is declared explicitly, an implicit default
universe@753 152 target is generated, which has the <code>alldependencies</code>
universe@753 153 flag set.
universe@753 154 </p>
universe@753 155 <p>
universe@753 156 The optional <code>name</code> attribute is also used to generate a prefix
universe@753 157 for the compiler and linker flags variables.
universe@753 158 Furthermore, a target may consist of an arbitrary number of <code>feature</code>,
universe@753 159 <code>option</code>, and <code>define</code> elements.
universe@753 160 Named dependencies can be listed (separated by comma) in the <code>dependencies</code>
universe@753 161 element. If this target shall use <em>all</em> available named dependencies, the empty
universe@753 162 element <code>alldependencies</code> can be used as a shortcut.
universe@753 163 </p>
universe@753 164 </xs:documentation>
universe@753 165 </xs:annotation>
universe@753 166 <xs:choice minOccurs="0" maxOccurs="unbounded">
universe@753 167 <xs:element name="feature" type="FeatureType"/>
universe@753 168 <xs:element name="option" type="OptionType"/>
universe@753 169 <xs:element name="define" type="DefineType"/>
universe@753 170 <xs:element name="dependencies" type="DependenciesType"/>
universe@753 171 <xs:element name="alldependencies">
universe@753 172 <xs:complexType/>
universe@753 173 </xs:element>
universe@753 174 </xs:choice>
universe@753 175 <xs:attribute name="name" type="xs:string"/>
universe@753 176 </xs:complexType>
universe@753 177
universe@753 178 <xs:complexType name="FeatureType">
universe@753 179 <xs:annotation>
universe@753 180 <xs:documentation>
universe@753 181 Declares an optional feature, that can be enabled during configuration, if all
universe@753 182 <code>dependencies</code> are satisfied.
universe@753 183 If a feature is enabled, all <code>define</code> and <code>make</code> definitions are
universe@753 184 supposed to be applied to the config file.
universe@753 185 In case the optional <code>default</code> attribute is set to true, the feature is enabled by default
universe@753 186 and is supposed to be automatically disabled (without error) when the dependencies are not satisfied.
universe@753 187 The name that is supposed to be used for the --enable and --disable arguments can be optionally
universe@753 188 specified with the <code>arg</code> attribute. Otherwise, the <code>name</code> is used by default.
universe@753 189 </xs:documentation>
universe@753 190 </xs:annotation>
universe@753 191 <xs:choice minOccurs="0" maxOccurs="unbounded">
universe@753 192 <xs:group ref="TargetDataGroup"/>
universe@753 193 </xs:choice>
universe@753 194 <xs:attribute name="name" type="xs:string" use="required"/>
universe@753 195 <xs:attribute name="arg" type="xs:string"/>
universe@753 196 <xs:attribute name="default" type="xs:boolean" default="false"/>
universe@753 197 </xs:complexType>
universe@753 198
universe@753 199 <xs:complexType name="OptionType">
universe@753 200 <xs:annotation>
universe@753 201 <xs:documentation>
universe@753 202 Declares a configuration option.
universe@753 203 The option argument name is specified with the <code>arg</code> attribute.
universe@753 204 Then, the children of this element specify possible <code>values</code> by defining the conditions
universe@753 205 (in terms of dependencies) and effects (in terms of defines and make variables) of each value.
universe@753 206 Finally, a set of <code>default</code>s is specified which supposed to automagically select the most
universe@753 207 appropriate value for a specific platform under the available dependencies (in case the option is not
universe@753 208 explicitly specified by using the command line argument).
universe@753 209 </xs:documentation>
universe@753 210 </xs:annotation>
universe@753 211 <xs:sequence>
universe@753 212 <xs:element name="value" type="OptionValueType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 213 <xs:element name="default" type="OptionDefaultType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 214 </xs:sequence>
universe@753 215 <xs:attribute name="arg" type="xs:string" use="required"/>
universe@753 216 </xs:complexType>
universe@753 217
universe@753 218 <xs:complexType name="OptionValueType">
universe@753 219 <xs:annotation>
universe@753 220 <xs:documentation>
universe@753 221 Declares a possible value for the option (in the <code>str</code> attribute) and
universe@753 222 the conditions (<code>dependencies</code>) and effects, the value has.
universe@753 223 </xs:documentation>
universe@753 224 </xs:annotation>
universe@753 225 <xs:choice minOccurs="0" maxOccurs="unbounded">
universe@753 226 <xs:group ref="TargetDataGroup"/>
universe@753 227 </xs:choice>
universe@753 228 <xs:attribute name="str" type="xs:string" use="required"/>
universe@753 229 </xs:complexType>
universe@753 230
universe@753 231 <xs:complexType name="OptionDefaultType">
universe@753 232 <xs:annotation>
universe@753 233 <xs:documentation>
universe@753 234 Specifies a default value for this option. Multiple default values can be specified, in which case
universe@753 235 they are checked one after another for availability. With the optional <code>platform</code> attribute,
universe@753 236 the default value can be constrained to a <em>single</em> specific platform and is supposed to be
universe@753 237 skipped by configure, when this platform is not detected.
universe@753 238 </xs:documentation>
universe@753 239 </xs:annotation>
universe@753 240 <xs:attribute name="value" type="xs:string" use="required"/>
universe@753 241 <xs:attribute name="platform" type="xs:string"/>
universe@753 242 </xs:complexType>
universe@753 243
universe@753 244 <xs:group name="TargetDataGroup">
universe@753 245 <xs:choice>
universe@753 246 <xs:element name="define" type="DefineType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 247 <xs:element name="dependencies" type="DependenciesType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 248 <xs:element name="make" type="MakeVarType" minOccurs="0" maxOccurs="unbounded"/>
universe@753 249 </xs:choice>
universe@753 250 </xs:group>
universe@753 251
universe@753 252 <xs:complexType name="DefineType">
universe@753 253 <xs:annotation>
universe@753 254 <xs:documentation>
universe@753 255 Specifies C/C++ pre-processor definitions that are supposed to
universe@753 256 be appended to the compiler flags, if supported.
universe@753 257 (Note: for example, Fortran also supports C/C++ style pre-processor definitions under
universe@753 258 certain circumstances)
universe@753 259 </xs:documentation>
universe@753 260 </xs:annotation>
universe@753 261 <xs:attribute name="name" type="xs:string" use="required"/>
universe@753 262 <xs:attribute name="value" type="xs:string"/>
universe@753 263 </xs:complexType>
universe@753 264
universe@753 265 <xs:simpleType name="DependenciesType">
universe@753 266 <xs:annotation>
universe@753 267 <xs:documentation>A comma-separated list of named dependencies.</xs:documentation>
universe@753 268 </xs:annotation>
universe@753 269 <xs:restriction base="xs:string"/>
universe@753 270 </xs:simpleType>
universe@753 271
universe@753 272 <xs:simpleType name="MakeVarType">
universe@753 273 <xs:annotation>
universe@753 274 <xs:documentation>
universe@753 275 The text contents in the body of this element are supposed to be appended literally
universe@753 276 to the config file without prior processing.
universe@753 277 </xs:documentation>
universe@753 278 </xs:annotation>
universe@753 279 <xs:restriction base="xs:string"/>
universe@753 280 </xs:simpleType>
universe@753 281 </xs:schema>

mercurial