Your build system is a C program v3.0.0
IncludeBuild is one header. Your build is a small C program that you compile once with the compiler you already have — after that it looks after itself. Underneath: parallel compilation, minimal rebuilds, a real target graph, and a built-in command line.
The Gist
#define IB_IMPLEMENTATION
#include "build.h"
int main(int argc, char** argv) {
ib_init(argc, argv);
ib_sources(ib_executable("app"), "**.c");
return ib_build();
}
$ cc -o build build.c # the first and last time you compile it yourself
$ ./build # parallel, incremental debug build
$ ./build release # optimized build in its own object tree
$ ./build run # build the executable, then run it
$ ./build clean
$ ./build compdb # compile_commands.json, kept fresh forever after
$ ./build help
Edit build.c and the next ./build recompiles
and re-runs itself. Edit a header and exactly the right files rebuild.
Change a flag and only what it touches recompiles —
./build -v tells you why each action ran.
What You Get
- Parallel compilation across all targets (
-jN, defaults to your CPU count). - Minimal rebuilds backed by compiler depfiles and remembered command lines.
- Executables, static and shared libraries, and
ib_use(app, lib)to wire them together — link order, include propagation, and-fPIChandled. - Globs with
*,?, and cross-directory**; patterns that match nothing are an error, not a silent no-op. - Configuration as a struct —
ib.cc = "clang";— not thirty setters. - A self-rebuilding build script and an always-current
compile_commands.json.
Platform Support
GCC-compatible toolchains (gcc, clang, MinGW) on Linux, macOS, and
Windows. Defaults honor $CC, $CXX, and
$AR.
Get Started
Download build.h
Copy it into your
project, write build.c, bootstrap once. That's the whole install.