MakeMe File Processing
MakeMe builds targets according to a defined life cycle.
- The MakeMe DOM object me is created and initialized.
- The start.me file is read to determine which platforms to build. For each platform specified in the start.me 'platforms' collection, the following steps below are executed.
- The directories collection dir, and me.global properties are initialized.
- The os/OS.me file is loaded for the required platform to supply O/S specific rules and definitions
- The standard.me file is loaded to supply with the standard MakeMe definitions.
- The platform MakeMe file is loaded and all MakeMe files referenced in blend[] are loaded depth-first. This continues recursively, depth first.
- All relative paths in the target properties: includes, headers, resources, sources and files are rebased relative to the directory supplying the MakeMe file. Scripts lacking a home directory property default to the directory containing the MakeMe file.
- Targets are enabled or disabled depending on their enable property expression.
- A list of top-level targets to build is created based on the MakeMe commandline and target dependencies. See below Selecting Targets for more details.
- The targets to build are examined and their properties are blended with the defaults/internal properties.
- The target dependencies are resolved and added to the target list.
- The target sources have wild-cards expanded. Targets are dynamically created for all objects to be built. The C/C++ source files are parsed and header targets are built for non-system include directives that have no leading spaces. i.e. #include "filename" starting in column 0.
- The target is built. If the target is an executable, library, or object, it is built using the transition rules specified in me.rules. If the target has a build event script, it is run.
Selecting Targets
MakeMe follows a simple process when selecting the targets to build.
- The set of names specified on the MakeMe command line is used as a starting target list. If the name does not match a target name, the list of targets is search to see if the name matches any targets with a type of that name. All matching targets are added to the list. For example: this allows targets of type clean to be run when me clean is invoked.
- If no names are specified on the MakeMe command line, a default build is performed. A list of candidate targets to build is populated with all executables, libraries, files and scripts with a type of "build".
- Targets that are disabled (enable property evaluates to false) are removed from the list
- Targets referenced in the depends property are added to the list (recursively)
- Additional targets are created dynamically for source items to be compiled and include headers
To reiterate, there are thus two paradigms when invoking MakeMe:
- me target ...
- me action ...
When specifying a name that is a target, these must match the target name property. When specifying an action, these must match a target type property.