Cex.C - Comprehensively EXtended C Language Whereas not a build system, but an extended c compiler, that has a build system incorporated with it, like zig does.

CEX’s integrated build system, cexy$, eliminates the need for external tools like CMake, Make, Ninja, or Meson. Inspired by Zig-build and Tsoding’s nob.h, cexy$ adapts to your project’s complexity. Small projects can use a straightforward, configuration-driven mode, while larger or cross-platform projects can utilize low-level tools for fine-grained control over the build process.

Getting started with cexy$ involves a two-step process to create a project-specific build tool. The core of this system is the cex.c file, which acts as your build script—much like a Makefile or build.zig—and contains all the logic for compiling your project.

1. Bootstrap the Build Environment

For a new project, you first need to generate the cex.c build script. This is done by compiling the cex.h header into a temporary bootstrap executable.

1# This command compiles cex.h into a temporary 'cex' executable
2cc -D CEX_NEW -x c ./cex.h -o ./cex

After running this command, you will have a ./cex program. Running this program will generate a template cex.c file in your project directory, which you can then customize.

2. Compile Your Custom Build Tool

Once the cex.c file exists, you compile it to create the final, project-specific cex command-line tool. This new executable will contain your project’s unique build logic and will replace the temporary bootstrap tool.

1# This compiles your custom build script into the final 'cex' tool
2cc ./cex.c -o ./cex

Ready to Build

With these steps complete, the ./cex executable in your project directory is now your main entry point for all build-related tasks. You can use it to compile your code, run tests, and manage your project, all without relying on external build systems.