MakeMe Events

During processing, MakeMe will fire events that may trigger scripts to run. There are two groups of events:

The global events are triggered for general MakeMe processing and do not apply to a specific target. Target events apply to the current target being built. The current target is defined in the me.target property or the global TARGET property.

Global Events

NameDescription
loadedFired after all the required MakeMe files are loaded.
postconfigFired during configuration just prior to creating the platform MakeMe file.
preheaderFired during configuration after creating the platform MakeMe file and just prior to creating the me.h file.
pregenFired during project generation after creating the output project file but before emitting any content to the project.
gencustomFired during project generation after emitting top level definitions but before emitting the targets. This event is the opportunity to write custom variables and targets to the project.

Target Events

Here are the target events in order of firing

NameDescription
postblendFired after blending defaults into a target.
preresolveFired before resolving dependencies for a target
postresolveFired after resolving dependencies for a target
presourceFired before expanding source wildcards and creating object targets
postsourceFired after expanding source wildcards and creating object targets
precompileFired before compiling a source file used by a target
postcompileFired after compiling a source file used by a target
prebuildFired before building a target
buildFired to build the target
postbuildFired after building a target

Pack Events

Here are the pack events in order of firing.

NameDescription
withoutFired when configuring and a pack is explicitly deselected via --without.
configFired when configuring a pack.
generateFired when generating during pack discovery.

Defining Scripts

Scripts can be defined to run when the required event is triggered.

This can also be abbreviated by just supplying a string as script value. Be sure to use the + event aggregator to add to existing scripts for that event.

rocket: {
    type: 'exe',
    sources: [ '*.c' ],
    prebuild: "print('before building')",
    postbuild: "print('after building')",
},

These scripts are actually translated into a lower-level form when the MakeMe file is loaded. Scripts are translated into the scripts collection using a property name of the desired event.

rocket: {
    scripts: {
        prebuild: [{
            script: "print('before building')",
            home: '.',
            interpreter: 'ejs',
        }],
    },
    goals: ['rocket'],
},

For more details on how to set the home directory for the script or to specify a different script interpreter, see Scripts in the MakeMe User Guide.

© Embedthis Software. All rights reserved.