Mako compiles packages to cached native objects under .mako/cache/ (or $MAKO_CACHE), then links. Unchanged units skip clang -c.
.mako/cache/
meta.txt # COMPILER_CACHE_VERSION
typecheck/<fp>.ok # whole-program typecheck stamp
c/<fp>.c # generated C per unit
obj/<fp>.o # clang -c output
Fingerprints include: compiler cache version, full source + transitive deps, generated C bytes, opt/sanitize/target flags, and host feature defines (OpenSSL, etc.).
| Flag / env | Meaning |
|---|---|
| (default) | Incremental on |
--no-incremental |
Bypass caches |
-j N / MAKO_JOBS |
Parallel clang -c jobs (default: CPU count) |
MAKO_CACHE |
Override cache root |
MAKO_CACHE_LOG=1 |
Print HIT/MISS lines |
Wired into mako build, mako check, and mako run.
Independent object units compile in parallel (owned jobs + channels — no shared mutable typechecker). Dependency order for packages is preserved by merging path deps before codegen; object units for one binary are independent.
| Step | Clang? |
|---|---|
| Unchanged unit | No — reuse .o |
| Changed unit | clang -c only |
| Final binary | clang/ld link of .os + libs |
wasm / --emit-c / --sanitize / cross --target |
Monolithic build_c path |
There is no full LLVM/cranelift backend yet; C remains the IR.
unsafe in src/incremental.rs... traversal)..o.tmp.* then renamed..mko + manifests) matches a prior successful check — NLL/borrow is never skipped on a partial fingerprint..o cannot be linked after codegen-affecting changes.See SECURITY.md and PERFORMANCE.md.