MakeMe Samples

Here are some actual, working sample MakeMe files from various projects. We've added comments to highlight various issues:

Live MakeMe Files

Here are some MakeMe files from live projects using MakeMe served directly from GitHub.

Project Purpose URL
Embedthis Appweb Project main.me main.me
Embedthis Appweb Main library build libappweb.me
Embedthis Appweb Appweb main server program server.me
Embedthis Appweb ESP module MakeMe file esp.me
Embedthis Appweb Packaging targets installs.me
Embedthis Appweb Test targets test.me
Embedthis Appweb Stand-alone MakeMe file for SSL script targets start.me
Embedthis GoAhead Project main.me main.me
Embedthis Ejscript Project main.me main.me
Embedthis Ejscript Main library libejs.me
Embedthis Ejscript Ejscript command programs cmd.me
Embedthis Ejscript Ejscript class library core.me

Quick Snippets

Here are some quick snippets that you can use in your MakeMe files.

Building a Library.

targets: {
    libmpr: {
        type: 'lib',
        defines: [ 'FAST_MODE=1' ],
        sources: [ '*.c' ],
        headers: [ '*.h' ],
    },
},

This will compile the sources, export the header to the include directory and create the library.

Building a Static Library.

targets: {
    libmpr: {
        type: 'lib',
        sources: [ '*.c' ],
        headers: [ '*.h' ],
        static: true,
    },
},

Building an Executable.

Set the type to exe and nominate the dependent targets. Specify the required libraries.

targets: {
    appweb: {
        type: 'exe',
        depends: [ 'libappweb', 'libhttp', 'libmpr' ],
        libraries: [ 'm' ],
        sources: [ 'appweb.c' ],
    },
},

Conditional Building

This will build only on windows.

targets: {
    manager: {
        enable: "me.platform.like == "windows'",
        type: 'exe',
        rule: 'gui',
        depends: [ 'libmpr' ],
        sources: [ 'manager.c' ],
    },
}

Inheriting Shared Settings

To share settings between multiple targets, define a collection of properties and then inherit from the desired targets.

{
    'shared-settings': {
        '+defines': [ 'NUMBER=42' ],
    },
    targets: {
        rocket {
            inherit: ['shared-settings'],
            type: 'exe'
            sources: '*.c',
        },
    }
}

Cross-Platform Target Paths

On windows, executables have a .exe extension, whereas on Unix, there is typically no such extension. MakeMe defines the EXE global variable to .exe on Windows and to empty on other platforms.

targets: {
    rocket: {
        type: 'exe',
        path: '${BIN}/short-range-rocket${EXE}'
    },
},

The path typically defaults to: ${BIN}/NAME${EXE} where NAME is the target name. But sometimes you need to override the output path. The ${EXE} can be used to formulate the path portably across platforms.

© Embedthis Software. All rights reserved.