#include "build.h"

A build system in one C header v3.0.0

IncludeBuild is a single-header build system for C and C++. Build scripts are C programs. It supports parallel compilation, incremental rebuilds, executable and library targets, and a built-in command line.

Basic Usage

#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   # bootstrap
$ ./build               # debug build
$ ./build release       # release build
$ ./build run           # build and run
$ ./build clean
$ ./build compdb        # create compile_commands.json
$ ./build help

Changes to build.c or build.h cause ./build to recompile itself. Header and flag changes rebuild affected targets. Use ./build -v to see why each command ran.

Features

Platform Support

GCC-compatible toolchains (gcc, clang, MinGW) on Linux, macOS, and Windows. Defaults honor $CC, $CXX, and $AR.

Get Started

Download build.h

View source Download build.h
curl -O https://includebuild.com/build.h

Copy build.h into your project, write build.c, and compile it once.