Makefiles: clean a target, make this more user friendly
as discussed on : https://discourse.cmake.org/t/makefiles-clean-a-target-make-this-more-user-friendly/427
Use case:
say a repository considered as 1 project
many libraries
many programs (as a result of combining functionality out of many of those libraries)
From the top of the buil directory for example we can build many of the targets (executables, libraries) and their dependencies. Say we have somewhere library/target “Foo”. The we can do:
make Foo
make Foo/fast
make clean
==>the later cleans the entire project
Now what if I would want to clean only library/target Foo.
One way I know on how to do that is cd-ing into the directory in the build tree corresponding to that library, and there I can issues “make clean” which is then restricted to just cleaning the library Foo (it just clean the local library), one can also do at that location “make clean/fast”. I have no idea what the difference is.
Now cd-ing to this location is not that user friendly, but one important thing is, that it is indeed possible to clean just the library.
I would like/propose that we could do the following at the top level of the build directory:
make Foo/clean
So kind of mimicking the fast ‘thing’.
So 2 axes to this proposal:
ability to clean the library/target from the top
syntax proposal “/clean”