A build system for C and C++ in one C header.
https://includebuild.com
- C 74.7%
- PowerShell 10%
- Shell 9.7%
- HTML 3.3%
- CSS 1.8%
- Other 0.5%
| .github/workflows | ||
| examples | ||
| scripts | ||
| tests | ||
| www | ||
| .gitignore | ||
| build.h | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| README.md | ||
IncludeBuild
The header-only build system for C that just works.
IncludeBuild turns build systems inside out: your build system is now part of your code.
The Gist
- Copy
build.hto your project. - Create
build.c:
#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_target_set_entry(target, "main.c");
ib_project_build(project, IB_MODE_DEBUG);
ib_project_destroy(project);
ib_context_destroy(ctx);
return 0;
}
- Compile and run:
cc -o build build.c
./build
If your platform prefers a specific compiler, gcc and clang work too. V2 plans an explicit build graph, writes depfiles/manifests, and builds your target incrementally.
Why IncludeBuild?
vs Make/CMake/Ninja
- No new language: It's just C. You already know it.
- Zero dependencies: No need to install Python, CMake, or Ninja. Just a C compiler.
- Debuggable: It's a standard C program. You can step through your build process in a debugger.
vs nob.h
IncludeBuild and nob.h share the philosophy of "C as a build language", but they target different layers of abstraction.
- nob.h is a library of tools (string builders, process execution, file operations) that lets you write a build system from scratch. You explicitly construct commands string-by-string.
- IncludeBuild is a build framework. It gives you project and target objects, per-target compile graphs, depfile-backed incremental rebuilds, and generated
compile_commands.jsonoutput from the same planned actions used to build.
Documentation
License
CC0 1.0 Universal. See LICENSE.