streamline make clean
list maintenance
#3256
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When creating a new
Makefile
target to build,it's also necessary to update the
clean
target,which purpose is to remove built targets when they are present.
This process is simple, but it's also easy to forget : since there is a large distance between the position in the
Makefile
where the new built target is added, and the place where the list of files toclean
is defined. Moreover, the list of files becomes pretty long over time, hence it's difficult to visually ensure that all built targets are present there, or that no old target (no longer produced) is no longer in the listThis PR tries to improve this process by adding a
CLEAN
variable. Now, when a new built target is added to theMakefile
, it should preceded by :This new requirement is somewhat similar to
.PHONY: newTarget
for non-built targets.This new method offers the advantage of locality : there is no separate place in the file to maintain a list of files to clean. This makes maintenance of
make clean
easier.Also :
changed
valgrindTest
intotest-valgrind
,to follow the same convention of all other test targets defined in
tests/Makefile
.