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
blendMakeMe 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.
customizeOptional MakeMe files to load after fully loading all blended MakeMe files
defaultsDefault properties to be inherited by all targets
dirDirectories 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
envEnvironment variables to set when compiling and linking
extFile extensions indexed by file type
globalsGlobal values to use in property token expansion
internalDefault properties to be inherited by only the targets in the same MakeMe file
mainPath to the file. Used in platform MakeMe files.
mixinLiteral script code to mixin.
modulesList of scripts or compiled scripts to pre-load
optionsSupplied command line options
platformDescription of the current platform. Has properties for operating system and CPU architecture.
pluginsList of required plugins. These are listed without '.me' extensions.
prefixesInstallation 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: ${}/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}
profilesBuild profiles. Standard profiles are: debug and release
rulesCommand rules for compiling, building libraries and executables
scriptsProject top-level scripts.
settingsProject top-level settings. This includes name, version, description. See settings collection below for full details.
targetReference to the currently building target.
targetsTargets to build. Each target is its own collection of properties
usageAdditional usage message to emit for MakeMe command line errors

Globals — me.globals.*

The following me.globals.* are defined for use by tokens:

Name Description
ARCHCPU architecture: x86, x64, ppc, ...
BINBinary outputs directory: OS-ARCH-PROFILE/bin
BLDBuild output directory
CONFIGPlatform configuration: OS-ARCH-PROFILE
EXEExecutable extension: .exe
GCC_ARCHCPU architecture mapped to a GCC architecture: x86_64, i686, ...
LIKESet to windows or posix if relevant
INCStandard include directory
LBINBinary output directory for the local platform
OCompiled object file extension: .o, .obj
OBJDirectory holding compiled files: OS-ARCH-PROFILE/obj
OSOperating system: linux, windows, ...
OUTPer-platform output directory: build/OS-ARCH-PROFILE
PAKSLocal Paks directory: src/paks
PKGPackage directory: build/OS-ARCH-PROFILE/pkg
PLATFORMPlatform string: OS-ARCH
PROFILESelected build profile. Typically 'debug' or 'release'
PROJGenerated projects directory. Typically 'projects'
RELRelease image directory: build/OS-ARCH-PROFILE/img
SHLIBShared object library extension: .so, .lib
SHOBJShared object extension: .so, .dll
SRCDirectory of the source tree to be built
TOPTop directory where the project is being built

Platform Collection — me.platform.*

The platform collection defines properties for:

Name Description
archCPU architecture: arm, ppc, x64, x86, ...
likeSet to 'windows' or 'posix' or empty
osOperating system: linux, windows, vxworks, ...
profileBuild profile selected: 'debug', 'release', ...

Configure Collection — me.settings.*

The configure collection specifies the configurable targets used to extend the project.

Name Description
discoversList of optional configurable components to discover when configuring
requiresList of required components to discover when configuring
extrasList 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 file.

Name Description
companyCompany name
prefixesName 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.
productProduct or project name. Should be one word, lower case without spaces
staticBuild using static linking instead of building shared libraries
titleDescriptive one sentence title for the product
versionProduct version string. Should be of the form: MAJOR.MINOR.PATCH

Targets Properties — me.targets[].*

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[].*

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)

conflictsArray of conflicting configurable targets
descriptionDescriptive name of the configurable target
requiresArray of targets to discover that are essential for this target
discoversArray of targets to discover that may be optionally utilized by this target
enableSet to true if the target was found on the system
fileFile to the MakeMe file that defined the target
importsFiles to import for this target into the platform bin directory before building
pathIf found, the path to the configurable target directory or binary
withpathPath supplied via a configure --with EXTENSION=PATH command line option

Scripts Collection — me.scripts.*

Name Description
preblendArray of scripts to run for the preblend event
postloadArray of scripts to run for the postload event
loadedArray of scripts to run for the loaded event
preinheritArray of scripts to run for the preinherit event
postconfigArray of scripts to run for the postconfig event
preheaderArray of scripts to run for the preheader event
pregenArray of scripts to run for the pregen event
gencustomArray of scripts to run for the gencustom event

Target Scripts Collection — me.targets[].scripts.*

Name Description
postblendArray of scripts to run for the postblend event
preresolveArray of scripts to run for the preresolve event
postresolveArray of scripts to run for the postresolve event
presourceArray of scripts to run for the presource event
postsourceArray of scripts to run for the postsource event
precompileArray of scripts to run for the precompile event
postcompileArray of scripts to run for the postcompile event
prebuildArray of scripts to run for the prebuild event
buildArray of scripts to run for the build event
postbuildArray of scripts to run for the postbuild event

Configurable Target Scripts Collection — me.targets[].scripts.*

Name Description
withoutArray of scripts to run for the without event
configArray of scripts to run for the config event

© Embedthis Software. All rights reserved.