How to avoid “No such file or directory” Error for `make clean` Makefile target

后端 未结 5 1998
野的像风
野的像风 2021-01-04 00:28

I have a Makefile that defines a .PHONY clean target for cleaning up .o files and executables, that target looks like:

...
.PHONY : clean
clean:
    rm $(add         


        
5条回答
  •  囚心锁ツ
    2021-01-04 00:59

    Use rm -f (or even better $(RM), provided by built-in make rules, which can be found out using make -p) instead of rm in your cleanrule.

提交回复
热议问题