#include "build.h"

Build Systems, But In C

IncludeBuild is a single-header build framework for C and C++ projects. Your build logic lives in build.c, uses normal C control flow, and drives an explicit project and target graph.

The Gist

#define INCLUDEBUILD_IMPLEMENTATION
#include "build.h"

int main(void) {
    ib_context* ctx = ib_context_create();
    ib_project* project = ib_project_create(ctx, ".");
    ib_target* target = ib_project_add_target(project, "app", IB_TARGET_EXECUTABLE);
    ib_status status = IB_OK;

    if (target) {
        status = ib_target_set_entry(target, "main.c");
    }
    if (status == IB_OK) {
        status = ib_project_build(project, IB_MODE_DEBUG);
    }

    ib_project_destroy(project);
    ib_context_destroy(ctx);
    return status == IB_OK ? 0 : 1;
}

Compile and run it:

$ cc -o build build.c
$ ./build

What You Get

Platform Support

IncludeBuild targets GCC/Clang-style toolchains on Linux, macOS, and Windows. The default compilers are cc/c++ on Unix-like platforms and gcc/g++ on Windows, and you can override them per project.

Get Started

Download build.h

Download build.h
curl -O https://raw.githubusercontent.com/korzewarrior/includebuild/master/build.h

Copy it into your project and write build.c like any other small C program.