Skip to content

lurkydismal/module_template

module_template

Example module layout for build system.

Table of Contents

General Information

  • The build system expects each module to provide config.sh which exports globs for what to include and what to compile.

Technologies Used

  • GNU bash 5.3.3
  • clang 21.1.4
  • gtest - 1.17.0-1

Features

header_frequency.sh helps pick candidates for a precompiled header by counting #include occurrences.

Setup

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_INCLUDE should point at public headers users of the module must add to include paths.
  • FILES_TO_COMPILE should 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.sh will itself scan directories.
  • Keep config.sh side-effect free except for exporting variables. Make it safe to source multiple times.

Usage

  1. Copy this folder into your top-level <module-name>/.
  2. Edit include/ and src/ to implement your API and logic.
  3. Update config.sh to export the exact globs or file list your build system expects.
  4. Commit the module.
  5. 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 Status

Project is: complete.

License

This project is open source and available under the GNU Affero General Public License v3.0.

About

Module template for build system

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors