MakeMe DOM
The MakeMe DOM allows you to access and manipulate the entire MakeMe model for how to build a project. Every
target, rule and dependency are all stored and exposed via the MakeMe DOM.
The DOM is created by loading one or more MakeMe files that provide portions of the DOM. Some of these MakeMe
files are provided internally by MakeMe to define operating system specific semantics and one or more are provided
by the user. All are blended into a single DOM object.
DOM Root
The root of the MakeMe DOM is a singleton global object called me. From it, all properties of the DOM
are accessible. To see the entire DOM for your project, run:
$ me --dump
[Dump] Save MakeMe DOM to: macosx-x64-debug.dmp
Top Level — me.*
Here is a non-exhaustive description of the important top-level MakeMe property collections.
Name |
Description |
blend | MakeMe files to blend.
This is an array of files to load. These paths may include the wild-card "*" character to
match a filename portion and "**" to match any file or directory at any depth in the directory
tree. If the filename is not found, "~/.paks" is searched for a matching Pak. |
customize | Optional MakeMe files to load after fully loading all blended MakeMe files |
defaults | Default properties to be inherited by all targets |
dir | Directories used by MakeMe. These must be absolute paths so that they can be used
when the current directory is changed while processing.
- work — Path to the current directory from where MakeMe is being initiated
- top — Path to the top of the source to build
- src — Path to a "src" directory under top where the pure source code lives
- home — User's home directory
- bld — Build output directory under "work"
- out — Platform output directory under the "bld" directory
- bin — Platform output executables and libraries directory under the "out" directory
- inc — Platform includes "inc" directory under the "out" directory
- obj — Platform objects directory under the "out" directory
- me — Path to the MakeMe product scripts directory
|
env | Environment variables to set when compiling and linking |
ext | File extensions indexed by file type |
globals | Global values to use in property token expansion |
internal | Default properties to be inherited by only the targets in the same MakeMe file |
main | Path to the main.me file. Used in platform MakeMe files. |
mixin | Literal script code to mixin. |
modules | List of scripts or compiled scripts to pre-load |
options | Supplied command line options |
platform | Description of the current platform. Has properties for operating system
and CPU architecture. |
plugins | List of required plugins. These are listed without '.me' extensions. |
prefixes | Installation directory prefixes and default values on Unix/Linux systems:
- root — Root directory prefix: /
- base — Base installation prefix: /usr/local
- data — Installation prefix for modifiable data: /
- state — Base installation prefix: /var
- app — Base application directory: /usr/local/lib/${settings.product}
- vapp — Versioned application directory: ${prefixes.product}/${settings.version}
- etc — Configuration prefix: ${prefixes.data}/etc/${settings.product}
- bin — Binary directory: ${prefixes.base}/bin
- inc — Include directory: ${prefixes.base}/include
- lib — Product libraries: ${prefixes.base}/lib
- man — Product log files: ${prefixes.base/share/man
- sbin — System binaries: ${prefixes.base}/sbin
- log — Product log files ${prefixes.state}/log/${settings.product}
- spool — Product spool files ${prefixes.state}/spool/${settings.product}
- cache — Product spool files ${prefixes.state}/cache/${settings.product}
- web — Product log files ${prefixes.state}/www/${settings.product}-default
- src — Product source /usr/src/${settings.product}-${settings.version}
|
profiles | Build profiles. Standard profiles are: debug and release |
rules | Command rules for compiling, building libraries and executables |
scripts | Project top-level scripts. |
settings | Project top-level settings. This includes name, version, description.
See settings collection below for full details. |
target | Reference to the currently building target. |
targets | Targets to build. Each target is its own collection of properties |
usage | Additional usage message to emit for MakeMe command line errors |
Globals — me.globals.*
The following me.globals.* are defined for use by tokens:
Name |
Description |
ARCH | CPU architecture: x86, x64, ppc, ... |
BIN | Binary outputs directory: OS-ARCH-PROFILE/bin |
BLD | Build output directory |
CONFIG | Platform configuration: OS-ARCH-PROFILE |
EXE | Executable extension: .exe |
GCC_ARCH | CPU architecture mapped to a GCC architecture: x86_64, i686, ... |
LIKE | Set to windows or posix if relevant |
INC | Standard include directory |
LBIN | Binary output directory for the local platform |
O | Compiled object file extension: .o, .obj |
OBJ | Directory holding compiled files: OS-ARCH-PROFILE/obj |
OS | Operating system: linux, windows, ... |
OUT | Per-platform output directory: build/OS-ARCH-PROFILE |
PAKS | Local Paks directory: src/paks |
PKG | Package directory: build/OS-ARCH-PROFILE/pkg |
PLATFORM | Platform string: OS-ARCH |
PROFILE | Selected build profile. Typically 'debug' or 'release' |
PROJ | Generated projects directory. Typically 'projects' |
REL | Release image directory: build/OS-ARCH-PROFILE/img |
SHLIB | Shared object library extension: .so, .lib |
SHOBJ | Shared object extension: .so, .dll |
SRC | Directory of the source tree to be built |
TOP | Top directory where the project is being built |
Platform Collection — me.platform.*
The platform collection defines properties for:
Name |
Description |
arch | CPU architecture: arm, ppc, x64, x86, ... |
like | Set to 'windows' or 'posix' or empty |
os | Operating system: linux, windows, vxworks, ... |
profile | Build profile selected: 'debug', 'release', ... |
Configure Collection — me.settings.*
The configure collection specifies the configurable targets used to extend the project.
Name |
Description |
discovers | List of optional configurable components to discover when configuring |
requires | List of required components to discover when configuring |
extras | List of components that but can be included via an explicit
configure --with NAME command. |
Settings Collection — me.settings.*
The settings collection specifies the top level project/product names. It is required in the main.me file.
Name |
Description |
company | Company name |
prefixes | Name of collection containing installation prefixes.
Set to debian|embedthis|opt or to a user-provided collection. This causes the requested prefix collection
to be copied to the prefixes collection. |
product | Product or project name. Should be one word, lower case without spaces |
static | Build using static linking instead of building shared libraries |
title | Descriptive one sentence title for the product |
version | Product version string. Should be of the form: MAJOR.MINOR.PATCH |
Targets Properties — me.targets[].*
Name | Description |
compiler |
Array of compiler options |
configurable |
Boolean set to true if the target is a configurable target used during the
configure phase. |
defines |
Array of compiler pre-processor definitions |
depends |
Array of other targets that are used by this target. Dependencies are built first.
The defines, includes, libraries and other properties of the depended upon targets
are inherited by the target. |
enable |
Ejscript expression to evaluate to a boolean. Enable the target if true.
This must be a quoted string to delay execution. Otherwise it will be evaluated when the
MakeMe file is first loaded. |
exclude |
Regular expression of file patterns to exclude from the sources list
This is a filter that is applied to the sources list after expanding the sources wildcards |
goals |
Array of goal targets for which this target will be built. This will typically
include the name of the target itself. Other possible goals are: 'all' for default builds,
'generate' for targets that should be included in project generation. |
headers |
Header files to export to the platform/inc directory. |
home |
Home directory to use when resolving paths for this target |
ifdef |
List of targets that are needed by this target. The target will not be built
if any of the specified targets are missing or not enabled. |
include |
Regular expression of file patterns to include from the sources list.
This is a filter that is applied to the sources list after expanding the sources wildcards |
includes |
Array of compiler include directories |
libraries |
Array of libraries to link |
libpaths |
Array of link library search paths |
linker |
Array of linker options |
message |
Message to display when building. Should be of the form: "Tag: Message". |
name |
Target name. This name is used rather than the collection name |
path |
Path to the result of building the target. If unset, MakeMe computes the output path
based on the target name and the target type. If the path is set, it overrides the default
and defines the output filename or directory for the target.
|
platforms |
Platforms for which this target should be built. Set to OS-ARCH or local
for the local platform. |
rule |
Build command template to use when invoking compiler and linker. Typically not
explicitly set unless overriding for some reason. Set to: 'c->o', 'cpp->o', 'lib', 'exe', 'gui'. Rules are automatically selected for 'lib' and 'exe' targets. |
scripts |
Scripts for the target. See scripts for details. |
sources |
Array of source file patterns to compile for the target. Use normal * as a
wild-card, ** as a wild-card that descends directories. Use the exclude property to exclude |
type |
Type of target: exe, lib, action, obj, header, build and custom values.
- exe — Executable type
- lib — Library type
- obj — Object type from compiled source. These are dynamically created from
the sources property.
- header — Headers are dynamically discovered and created from source files.
- action — Script type that is run when explicitly specified as a target on the
MakeMe command line, or as a dependency for another target.
- build — Script type that is run for default builds.
- custom values — Targets may be set to any custom type. If MakeMe is invoked with a
type specified as a target, then all the targets of that type will be run.
|
uses |
Soft dependency. Array of other targets that may be used by this target.
The specified targets are built first if enabled. This target will be built regardless of whether
the targets specified in "uses" are present or enabled or not.
The defines, includes, libraries and other properties of the depended upon targets
are inherited by the target. |
Additional Target Properties for File Targets — me.targets[].*
Name | Type | Description |
active |
Boolean |
If a destination file is an active executable or library, rename the active file using
a '.old' extension and retry. |
append |
Boolean |
Set the operation to catenate input files into a single output file. Same as
'operation: "append"' |
compress |
Boolean |
Compress destination files using Zlib. Results in a '.gz' extension. |
divider |
String |
Divider text to use between appended files. |
extension |
String | Path |
Extension to use for the destination filenames. |
extensionDot |
String |
Specifies where the filename extension begins for filenames with multiple dots.
Set to 'first' or 'last'. |
filter |
RegExp |
Pattern of lines to filter out from appended files. |
flatten |
Boolean |
Flatten the input source tree to a single level. Defaults to true. |
footer |
String |
Footer to append when appending files. |
group |
String | Number |
Group permission name or number to use for the destination files. |
header |
String |
Header prepend when appending files. |
isDir |
Boolean |
Assume the destination is a directory. Create if it does not exist. Same as appending a
trailing '/' to the 'to' argument. |
keep |
Boolean |
Keep uncompressed file after compressing. |
operation |
String |
Set to 'append' to append files, 'copy' to copy files and 'move' to move files.
Set to 'list' to return a file list in options.list and perform no operations. Defaults to 'copy' if unset. |
patch |
Object |
Expand file contents tokens using this object. Object hash containing properties to use
when replacing tokens of the form ${token} in file contents. |
permissions |
Number |
Posix style permissions mask. E.g. 0644. |
relative |
Boolean | String | Path |
Create destination filenames relative to the path provided by the
'relative' option, otherwise destination filenames include the Path value. If set to true, the destination
will be relative to the current directory. If set, implies flatten == false. Defaults to false. |
rename |
Function |
Callback function to provide a new destination filename. Calling sequence:
Function(from, to, options): Path. |
divider |
Boolean |
Keep uncompressed file after compressing. |
strip |
Boolean |
Run 'strip' on the destination files. |
symlink |
String | Path |
Create a symbolic link to the destination. If symlink has a trailing '/'
a link is created in the directory specified by 'symlink' using the source file
basename as the link name. |
trim |
Number |
Number of path components to trim from the start of the source filename.
If set, implies flatten == false. |
user |
String | Number |
User account name or number to use for destination files. |
Configurable Targets Collection — me.targets.*
These properties are relevant only if the target is configurable (has configurable == true)
Name | Description |
conflicts | Array of conflicting configurable targets |
description | Descriptive name of the configurable target |
requires | Array of targets to discover that are essential for this target |
discovers | Array of targets to discover that may be optionally utilized by this target |
enable | Set to true if the target was found on the system |
file | File to the MakeMe file that defined the target |
imports | Files to import for this target into the platform bin directory before building |
path | If found, the path to the configurable target directory or binary |
withpath | Path supplied via a configure --with EXTENSION=PATH command line option |
Scripts Collection — me.scripts.*
Name |
Description |
preblend | Array of scripts to run for the preblend event |
postload | Array of scripts to run for the postload event |
loaded | Array of scripts to run for the loaded event |
preinherit | Array of scripts to run for the preinherit event |
postconfig | Array of scripts to run for the postconfig event |
preheader | Array of scripts to run for the preheader event |
pregen | Array of scripts to run for the pregen event |
gencustom | Array of scripts to run for the gencustom event |
Target Scripts Collection — me.targets[].scripts.*
Name |
Description |
postblend | Array of scripts to run for the postblend event |
preresolve | Array of scripts to run for the preresolve event |
postresolve | Array of scripts to run for the postresolve event |
presource | Array of scripts to run for the presource event |
postsource | Array of scripts to run for the postsource event |
precompile | Array of scripts to run for the precompile event |
postcompile | Array of scripts to run for the postcompile event |
prebuild | Array of scripts to run for the prebuild event |
build | Array of scripts to run for the build event |
postbuild | Array of scripts to run for the postbuild event |
Configurable Target Scripts Collection — me.targets[].scripts.*
Name |
Description |
without | Array of scripts to run for the without event |
config | Array of scripts to run for the config event |