The GitHub mirror is archived; build.h is served from includebuild.com
itself, so the site no longer depends on external repository links. The
FAQ keeps one link to the archived mirror for users pinning v2.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rebuild the engine and the API around the original goal: extremely
minimal, insanely powerful.
The public surface is now one macro, one config struct, and eleven
functions (from ~40 functions in v2), while the engine gains:
- Parallel compilation and linking with a process pool (-jN, default
CPU count), direct process spawning instead of popen/cmd.exe, and no
per-command chdir.
- A real target graph: ib_use() links libraries into targets with
transitive link ordering, include propagation, cycle detection, and
automatic -fPIC for static code reaching shared libraries.
- Globs (*, ?, **) with sorted, deduplicated, typo-safe expansion.
- A built-in CLI: build/run/clean/compdb/help/version, debug/release
modes with separate object trees, -j/-v/-q/--color.
- Self-rebuilding build scripts (build.c edits take effect on the next
./build, with the rename dance on Windows).
- Rebuild reasons (-v), ninja-style progress, wall-time summaries.
- compile_commands.json that auto-refreshes once created.
- Full command-line records instead of hashes, a stat cache, an arena
allocator, and a fail-fast error policy: 2081 lines vs 3228 in v2.
Command-line paths are forward-slashed on Windows so depfiles parse
unambiguously; verified with mingw + wine (parallel builds, incremental
settling, spaced paths).
Fixtures, examples, and both test suites (bash + PowerShell) rewritten
for the new API, with new coverage: use_lib relink cascades, glob
recursion, self-rebuild, run verb, and 11 diagnostic failure cases.
Website rewritten for v3. Line endings normalized via .gitattributes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Updated version patch number from 1 to 2 and improved logging and dependency handling. Refactored some internal functions for better clarity and performance.