In the clean section of my Makefile I am trying to check if the file exists before deleting permanently. I use this code but I receive errors.
Makefile
What\'s w
One line solution:
[ -f ./myfile ] && echo exists
One line solution with error action:
[ -f ./myfile ] && echo exists || echo not exists
Example used in my make clean directives:
make clean
clean: @[ -f ./myfile ] && rm myfile || true
And make clean always works without any error messages!