Bob is a build system written exclusively, for C projects.
Get the hell out of here c++ (middle finger emoji)
and yes, i do see the irony in using Make (another build system) for my new build system (i better not get any emails about this...ðŸ˜)
Figuring out lol
in bob.c file:
#define BOB_STRIP_PREFIXES
#define BOB_IMPL
#include "bob.h"
int main(int argc, char **argv) {
rebuild_yourself(argc, argv);
printf("Bob says Hi!\n");
Cmd cmd = {0};
cmd_append(&cmd, "gcc", "src/main.c", "-o", "build/main");
cmd_run(&cmd);
cmd_destroy(&cmd);
return 0;
}now in your terminal:
$ gcc bob.c -o bob
$ ./bobyour target executable is ./build/main:
$ ./build/mainThe bob.c file uses the bob.h header-only library functions
to build your C project
So effectively all you'll need to build your C project is just a C compiler
- run shell commands
- strip prefix macro for individual components (like string builder, cmd, etc...)
- strip prefix macro for all components (for usage in build script .c file
bob.c) - rebuild itself if the build script is changed
- functions to check if files/dirs exist
- function to make dir
- abstract away the specific compiler, especially in
bob_rebuild_yourself()