Skip to main content

Scripts & build entrypoints

Canonical workflow: morphc

For normal development, do not drive CMake by hand. Use the Python build driver invoked as:

OSEntry
Windowsmorphc.bat at repo root (runs python -m scripts.morphc_build)
macOS / Linuxpython3 -m scripts.morphc_build (same module; use morphc.bat on Windows only)

Implementation lives in scripts/morphc_build/. Workspace layout is derived from config/branding.toml: state under %LOCALAPPDATA%\<WorkspaceVendor>\workspaces\<canonical>\ (e.g. %LOCALAPPDATA%\Morph\workspaces\morph\), build dir build-mingw, logs in logs\.

Full command reference: morphc --help or see agents/BUILD_AND_TEST.md.

Thin wrappers (delegate to morphc)

WrapperWhat it runs
GNU Makemakepython3 -m scripts.morphc_build build (see repo Makefile)
morphc.bat%PY% -m scripts.morphc_build %*

Legacy / special-purpose scripts (scripts/)

These predate or complement morphc. Prefer morphc unless you are fixing CI, packaging, or legacy automation.

ScriptRole
build.batHistorical full Windows CMake+Ninja driver + DLL staging (workspace cache). CI may still reference it; local work should use morphc.
build_tests.ps1Targeted test runner against a fixed build directory (used by some flows / n.bat).
build_tests_v2.ps1Newer test runner (CI-oriented).
build_runtime.ps1Rebuilds only the C runtime/ slice in some setups.
build_installer.ps1Packaging / installer pipeline helpers.
strip_utf8_bom.pyMaintenance: strip BOMs from sources.

Note: Repo-root build.sh and build.ps1 still invoke raw cmake for configure/build. They are not wired to scripts.morphc_build; use them only if you intentionally bypass the unified driver (e.g. minimal Unix shells without the Python module).

n.bat: Shortcut that calls scripts\build.bat / build_tests.ps1 and hard-coded paths; it can diverge from morphc’s workspace. Prefer morphc.bat for consistency.

Environment overrides (optional)

Auto-detection is usually enough. The MinGW bin directory can be forced with the branded env name from config/branding.toml (for canonical = "morph" this is MORPH_TOOLCHAIN_BIN). LLVM_DIR is still honored when set (see scripts/morphc_build/config.py).

See also