cbuild.h file is an autogenerated file, created to make using this build system easier. This documentation will refer to CBuild as to collection of 10 files in src/ directory of this repository. This are 15 main modes and 1 implementation file (impl.c):
- common.h - Common and misceleanous code and all includes.
- Term.h - ANSI wrappers.
- Log.h - Generick printf-style logger, implements log levels.
- Arena - EXPERIMENTAL module! Provides temporary allocator.
- DynArray.h - Implementation of dynamic array in C.
- StringView.h - Implementation of a string view.
- StringBuilder.h - String builder based on dynamic array implementation.
- Map.h - Hash map implementation.
- Stack.h - Very simple dynamic stack implementation.
- Proc.h - Few utilites to work with child processes.
- Command.h - Command runner.
- FS.h - Filesystem and file APIs.
- Compile.h - Few utilites usefull when writing build scripts.
- DLload.h - Runtime dynamic loader abstraction.
- FlagParse.h - CLI flag parser.
The only real self-contained module is common.h. Second is Term.h that depends only on common module. Log.h depends on both. Then datatype modules - they depends on everything before - common module and logger. StringBuilder.h has more dependencies - dynamic array and string view are used. Dynamic array because string builder is a simple alias for it and string view - for inter-operations. Proc.h is the same - only common and logger modules are required. Both Command.h and Compile.h depends on common and logger modules as usual, but also has dependencies on dynamic array and string builder. Compile.h in addition also require filesystem module. FS.h depends on common and logger modules only. DLLoad.h is only dependant on common module. FlagParse depends on both common and log modules and also on dynamic arrays, string builder and string view.
cbuild.h header is simply a collection of other header, packed in a specifc order to make them work. Current build system limitation is includes. Only common.h can have included that will be in resulting cbuild.h.