make

    make command for MoonX.

    command-line
    moonx
    wasm
    Download zip
    Author
    Version
    0.2.6
    License
    Apache-2.0
    Last updated
    15 days ago
    Downloads
    240

    #make

    Run a Make language subset for MoonX.

    Development candidate: cli/make@0.2.6, using cli/core@0.9.3. Publication is pending. Earlier exact-coordinate acceptance is recorded in the changelog.

    moonx cli/make@0.2.6 [-B] [-k] [-n] [-s] [-j [N]] [-W FILE] [-C DIR] [-f FILE] [VARIABLE=VALUE] [TARGET...]

    #Supported scope

    Build targets with dependencies, variables, includes, conditionals, patterns, automatic variables, exports and parallel recipe chains.

    Recipe test -s uses the final target's metadata, including through symlinks, without opening it. Missing/cyclic targets are false; unavailable sizes such as macOS directories are explicit shell errors rather than fabricated zero.

    Computed assignment/export names expand once. =, :=, ::=, :::=, ?=, += and != retain their supported flavors and trailing value whitespace. Recursive export evaluation uses the original environment to break shell-valued export recursion, while ordinary variable recursion reports an error. .SHELLSTATUS records the actual shell result; $(shell ...) and != have distinct trailing newline rules. Recipe expansion and environment construction are serialized.

    .SECONDEXPANSION affects subsequent declarations and expands escaped variables with target automatic variables before dependency planning. Repeated declarations, recipe-bearing groups, $<, $^, $+ and pattern stems retain the fixed GNU 4.4.1 order. $? snapshots distinct changed prerequisites once per target, including missing targets, phony dependencies, -B and virtual -W times; later recipes do not recompute it after changing the target. Inline recipes retain the same rule ordering and literal recipe # bytes. Rule punctuation is recognized outside balanced variable/function references, so $(shell ...) can contain pipes, colons, semicolons and nested groups. This does not imply its full builtin rule/function database.

    $(MAKE) invokes this Wasm command recursively. Exported MAKELEVEL increments from the invocation level; MAKEFLAGS preserves supported flags, variable flavors, spaces and dollar transport. Recursive recipes and + recipes still run under -n. An existing POSIX --jobserver-auth=fifo:PATH shares real tokens, returns the exact borrowed byte on success/failure/cancellation and preserves the owner's FIFO. Its implicit slot is distinct from a borrowed token. Descriptor-pipe and Windows semaphore authentication reject explicitly.

    #Options

    OptionDescription
    -f, --file FILESelect a makefile.
    -C DIRChange working directory.
    -n, --just-printPrint recipes; recursive and + recipes still execute.
    -s, --silentSuppress recipe echo.
    -B, --always-makeForce rebuilding.
    -j [N]Run up to N recipe chains; bare -j allows all ready targets.
    -kContinue independent targets after failures.
    -W FILETreat FILE as newly modified.
    NAME=VALUE / TARGETSet variables / select targets.
    --help / --versionShow help / package version.

    #Limitations

    • Short flags must be separate: use -n -s, not -ns.
    • Creating a new FIFO jobserver requires a public FIFO creation API. Without an inherited server, local -jN is available and recursive children receive -j1 to stay within each occupied parent slot. This is an explicit scheduling limit.
    • Descriptor-pipe import, Windows named semaphore inheritance, full GNU builtin functions/rules, archive/order-only/target-specific/grouped/double-colon rules, special control targets and bare export-all reject. Known unsupported functions reject before argument expansion, including lazy branches with side effects; unknown ordinary variable names keep normal empty-value semantics.
    • Explicit SHELL assignments accept only literal sh or /bin/sh as names for the built-in pure MoonBit profile; .SHELLFLAGS accepts literal -c. Custom interpreters/flags, computed selectors and selector appends reject; inherited empty .SHELLFLAGS also rejects before recipe execution. An inherited environment SHELL does not select the interpreter and remains the child's environment value unless explicitly exported by make.
    • Recipes use the supported sh language subset.

    #Examples

    moonx cli/make@0.2.6 -n moonx cli/make@0.2.6 -f build.mk -j 2 all

    MakeError

    type MakeError

    Database

    type Database

    Rule

    type Rule

    Settings

    type Settings

    Variable

    type Variable