GitHub - tsoding/nob.h: Header only library for writing build recipes in C. (original) (raw)

nob.h - Next generation of the NoBuild

This library is the next generation of the NoBuild idea. "nob" stands for "nobuild", but it's shorter and more suitable as a prefix for a library.

For my previous iteration on this idea see https://github.com/tsoding/nobuild, but I do not recommend to use it.

NoBuild 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.

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 nob in a variety of my C projects at https://github.com/tsoding/. 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. (But in that case I personally think you have much bigger problem than a build system). 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

The only file you need from here is nob.h. Just copy-paste it to your project and start using it. See how_to/ folder for examples.

NoBuild in Other Languages

This is obviously applicable not only to C. You can implement the same kind of approach for other languages (apart from the languages that support this natively, of course). Here is few examples in the wild:

Feel free to contribute more