Repolode
tsoding

tsoding/nob.h

A single-header C library for writing build scripts in C, so a C compiler is the only build dependency.

Open-source alternative to:CMakeGNU Make

Stars
3,329
Forks
215
Open issues
85
Last commit
3 days ago

What is it?

nob.h is a single-file C library for writing build recipes in C instead of Make, CMake, or shell scripts. The idea, called NoBuild, is to bootstrap a project's build system with nothing more than a C compiler: you compile a small nob.c program once, and that program then builds the rest of the project.

The library is meant to be copied into a project as one header file. Because the build logic is ordinary C, the build script can reuse the project's own code directly, and the project can use helpers written for the build. The project describes itself as experimental and suited to C and C++ projects that want simple, portable builds rather than large dependency-management setups.

The author notes that it is closer to writing shell scripts in C than to using a full build generator, so it requires comfort with C and writing some utilities yourself. Ports of the same idea exist for C++, Java, and Fortran.

Key features

  • 01Distributed as a single header file, copied directly into the project.
  • 02Requires only a C compiler, with no make, CMake, or shell dependency.
  • 03Build logic is written in C and can share code with the project.
  • 04Runs on Linux, macOS, Windows, FreeBSD, and other platforms with a C compiler.

Use cases

  • Building small or medium C/C++ projects without installing make or CMake.
  • Writing portable build scripts that work the same across operating systems.
  • Bootstrapping a C project's build from a single compiler command.

Quick start

  1. 1

    Download the single header nob.h from the repository

  2. 2

    Copy nob.h into your project and start using it; see the how_to/ folder for examples

Things to know

  • The author describes it as an experimental research project with no claims of suitability.
  • It is not suited to projects that rely on CMake-style modules and many dependencies.
  • Writing build scripts requires being comfortable implementing things yourself in C.
  • It only makes sense for C and C++ projects.

Topics

FAQ

What is nob.h?
A single-header C library for writing build scripts in C, so a C compiler is the only build dependency. nob.h is a single-file C library for writing build recipes in C instead of Make, CMake, or shell scripts. The idea, called NoBuild, is to bootstrap a project's build system with nothing more than a C compiler: you compile a small nob.c program once, and that program then builds the rest of the project.
Is nob.h free to use? What license does it have?
nob.h is open source under the Other license. Check the license terms before using it in commercial products.
Is nob.h still maintained?
Actively maintained. The last commit to nob.h was on Oct 18, 2026.
What can I use nob.h for?
Building small or medium C/C++ projects without installing make or CMake. Writing portable build scripts that work the same across operating systems. Bootstrapping a C project's build from a single compiler command.
How do I install nob.h?
Download the single header nob.h from the repository Copy nob.h into your project and start using it; see the how_to/ folder for examples
Where can I get nob.h?
The source code and installation instructions are on GitHub: https://github.com/tsoding/nob.h

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects