The Makefile contains a single artifact target naming one source file explicitly:
all: testing
testing: src/testing.cpp
@echo "---"
@echo "Compiling testing.cpp"
g++ src/testing.cpp -o testing
@echo "Finished compiling testing.cpp"
Two gaps are visible for a starter template whose purpose is to be extended:
- A second source file is silently ignored. Adding
src/foo.cpp produces no build error and no link error — the file is simply never compiled, because both the prerequisite list and the g++ invocation name src/testing.cpp literally. The failure is silent, which is the hardest kind to notice when starting a project from this template.
- No
clean target exists. Removal of the build artifact is instead open-coded in cr.sh as rm ./testing, so the knowledge of what the build produces is duplicated in two places that can disagree.
Additionally, no warning flags are passed: g++ is invoked without -Wall -Wextra, so a project started from this template compiles with warnings suppressed by default.
Proposed resolution (each part is separable, and the wildcard change is the largest):
- Add a
clean target that removes ./testing, and have cr.sh call it instead of open-coding the removal.
- Consider building from a wildcard over
src/*.cpp so that added sources are picked up.
- Consider adding
-Wall -Wextra to the compile line.
Note that Makefile is the build contract inherited by every project generated from this template, so changes here deserve deliberate review rather than being folded into unrelated work.
This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson
The
Makefilecontains a single artifact target naming one source file explicitly:Two gaps are visible for a starter template whose purpose is to be extended:
src/foo.cppproduces no build error and no link error — the file is simply never compiled, because both the prerequisite list and theg++invocation namesrc/testing.cppliterally. The failure is silent, which is the hardest kind to notice when starting a project from this template.cleantarget exists. Removal of the build artifact is instead open-coded incr.shasrm ./testing, so the knowledge of what the build produces is duplicated in two places that can disagree.Additionally, no warning flags are passed:
g++is invoked without-Wall -Wextra, so a project started from this template compiles with warnings suppressed by default.Proposed resolution (each part is separable, and the wildcard change is the largest):
cleantarget that removes./testing, and havecr.shcall it instead of open-coding the removal.src/*.cppso that added sources are picked up.-Wall -Wextrato the compile line.Note that
Makefileis the build contract inherited by every project generated from this template, so changes here deserve deliberate review rather than being folded into unrelated work.This issue was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
drafted by Claude on behalf of Daniel Stephenson