Is there a way to make the command make clean
require user confirmation? I mistakenly executed it and now I have to wait 6 hours for the build to complete again.
The Makefile
s were created by cmake
.
Desired workflow:
> make clean
> [make] Are you sure you want to remove all the built files? [Y/N]
> N
> [make] Target 'make clean' not executed.
> make clean
> [make] Are you sure you want to remove all the built files? [Y/N]
> Y
> [make] Target 'make clean' executed.
make clean
. And I know no way for attach additional actions for clean target. (The only way to affect onmake clean
behavior is adding files to ADDITIONAL_MAKE_CLEAN_FILES). You may create another target (say,make remove
), in which call some sort of "prompt" and thenmake clean
.