Where, in a repository, should I put source code for tools used in the build only?

Suppose I have a repository for an application app_a. To build app_a, one needs to compile some sources (e.g. file1 and file2, never mind the file suffixes), but - it is also necessary to: Apply some utility executable util_b to file1.in to get file1. Apply some utility executable util_c to file2.o, the compiled object of file2 , to get file2_extra.o, which is used in linking app_a If util_b and util_c's sources are in another repository - then no problem, we just have to depend on them being available on the path, and not our problem. My question is: Suppose that util_b and util_c are bespoke, and their source are part of my repository. Where, in the repository, should I put their sources? And - should I treat them as just additional source files on which the executable indirectly depends, or should they be separated more strongly? Notes: I realize the answer for util_a and util_b might be different I am mostly interested in an answer for a C++ or C repository, with an idiomatic structure, e.g. as described in the Pitchfork repo or in P1204R0 Canonical project structure paper. If it matters, assume the application build is managed via some build system generator, e.g. CMake, meson, autotools etc.

Jun 11, 2025 - 19:10
 0

Suppose I have a repository for an application app_a. To build app_a, one needs to compile some sources (e.g. file1 and file2, never mind the file suffixes), but - it is also necessary to:

  1. Apply some utility executable util_b to file1.in to get file1.
  2. Apply some utility executable util_c to file2.o, the compiled object of file2 , to get file2_extra.o, which is used in linking app_a

If util_b and util_c's sources are in another repository - then no problem, we just have to depend on them being available on the path, and not our problem.

My question is: Suppose that util_b and util_c are bespoke, and their source are part of my repository. Where, in the repository, should I put their sources? And - should I treat them as just additional source files on which the executable indirectly depends, or should they be separated more strongly?

Notes:

  • I realize the answer for util_a and util_b might be different
  • I am mostly interested in an answer for a C++ or C repository, with an idiomatic structure, e.g. as described in the Pitchfork repo or in P1204R0 Canonical project structure paper.
  • If it matters, assume the application build is managed via some build system generator, e.g. CMake, meson, autotools etc.