User's Guide: preTools Suite for Windows

Getting Started

Reference

Configuration File

preMake.exe uses the configuration file named preMake.xml, preBuild.exe uses the configuration file named preBuild.xml, and preVCbld.exe uses the configuration file named preVCbld.xml. These files are located in the same directory as the corresponding exe file. They are well-formed XML text files.

A configuration file is a tree of XML elements and attributes. Each file has a root element which is the name of the preTool, i.e. prebuild , premake or prevcbld. The root element has a version attribute which is currently "2.00". The root element has four main sub-elements: detect, base_configurations, setups, and configurations.

The configuration file uses the detect element to store the build components and their registry paths. One or more component sub-elements enumerate the components which are to be detected by the preTool. The registry_path and registry_value elements are used to locate the component on the build system. Here is a snippet of a detect element which defines the "MSVC80" build component:

	<detect>
          ...
	  <component name="MSVC80">
	    <registry_path>...</registry_path>
	    <registry_value>...</registry_value>
	  </component>
	</detect>
		

The base_configurations element has one or more base_config sub-elements, one for each buiild component which is specified under detect. The base_config sub-element defines a default set of environment variables for a build component. In the snippet below, the MSVC80 base_config defines an environment variable named VCINSTALLDIR with the value of a macro: $(Base), which evaluates to the installation path for the component.

        <base_configurations>
          ...
	  <base_config name="MSVC80">
            <env name="VCINSTALLDIR">$(Base)</env>
            ...
          </base_config>
        </base_configurations>
		

In addition to env elements, base_config can contain a variety of conditional elements: ifeq, ifneq, ifndef, ifdef, switch, and case.

The setups element contains setup sub-elements which are used to define variations or customizations of the base_config environment definitions of the build components. A setup sub-element may contain any of the elements that are used in base_config definitions. Below is a setup snippet that defines a 64-bit compilation variation for a DDK:

	<setups>
          ...
	  <setup name="WIN2K3.3790.1830.amd64">
	    <env name="_bitness">AMD64</env>
	    ...
	  </setup>
	</setups>
		

The configurations element contains one or more configuration sub-elements which combine one or more components and setups. Below is a configuration snippet that defines the "vc6" configuration:

	<configurations>
          ...
	  <configuration name="vc6">
	    <setup>MSVC60.default</setup>
	    <component>MSVC60</component>
          </configuration>
	</configurations>
		

This configuration references a setup named "MSVC60.default" and requires the "MSVC60" component. The base_config environment definitions are loaded for the required components.