Home

Awesome

nobuild

Header only library for writing build recipes in C.

Main idea

The idea is that you should not need anything but a C compiler to build a C project. No make, no cmake, no shell, no cmd, no PowerShell etc. Only C compiler. So with the C compiler you bootstrap your build system and then you use the build system to build everything else.

Try it out right here:

$ cc ./nobuild.c -o nobuild
$ ./nobuild

Explore nobuild.c file and the examples folder to learn more.

This is an Experimental Project

I'm not sure if this is even a good idea myself. This is why I'm implementing it. This is a research project. I'm not making any claims about suitability of this approach to any project.

Right now I'm actively using nobuild only in bm. It works quite well for me there.

It's likely Not Suitable for Your Project

If you are using cmake with tons of modules to manage and find tons of dependencies you probably don't want to use this tool. nobuild is more like writting shell scripts but in C.

Advantages of nobuild

Disadvantages of nobuild

Why is it called "nobuild" when it's clearly a build tool?

You know all these BS movements that supposedly remove the root cause of your problems? Things like NoSQL, No-code, Serverless, etc. This is the same logic. I had too many problems with the process of building C projects. So there is nobuild anymore.

How to use the library in your own project

Keep in mind that nobuild.h is an stb-style header-only library. That means that just including it does not include the implementations of the functions. You have to #define NOBUILD_IMPLEMENTATION before the include. See our nobuild.c for an example.

  1. Copy nobuild.h to your project
  2. Create nobuild.c in your project with the build recipe. See our nobuild.c for an example.
  3. Bootstrap the nobuild executable:
    • $ cc nobuild.c -o nobuild on POSIX systems
    • $ cl.exe nobuild.c on Windows with MSVC
  4. Run the build: $ ./nobuild

If you enable the Go Rebuild Urself™ Technology the nobuild executable will try to rebootstrap itself every time you modify its source code.