Example module layout for build system.
- The build system expects each module to provide
config.shwhich exports globs for what to include and what to compile.
- GNU bash 5.3.3
- clang 21.1.4
- gtest - 1.17.0-1
header_frequency.sh helps pick candidates for a precompiled header by counting #include occurrences.
The build system must source or eval the module's config.sh. The template uses the following variables:
#!/bin/bash
# Export globs. The top-level build system expands these.
export FILES_TO_INCLUDE='include/*.hpp'
export FILES_TO_COMPILE='src/*.cpp'Rules and expectations:
FILES_TO_INCLUDEshould point at public headers users of the module must add to include paths.FILES_TO_COMPILEshould list source files the top-level build will compile or add to a library target.- Use shell globs or explicit file lists. The build system expands globs; do not assume
config.shwill itself scan directories. - Keep
config.shside-effect free except forexporting variables. Make it safe tosourcemultiple times.
- Copy this folder into your top-level
<module-name>/. - Edit
include/andsrc/to implement your API and logic. - Update
config.shto export the exact globs or file list your build system expects. - Commit the module.
- Run your top-level build tool. The build tool should detect
modules/<module-name>/config.sh, source it, add includes and compile units to the build graph.
Project is: complete.
This project is open source and available under the GNU Affero General Public License v3.0.