case 1:

Makefile

clean:
    rm a

environment_1 :
There is only file a

$ make clean

clean a

environment_2 :
There are two file a and clean

$ make clean
make: 'clean' is up to date.

can't clean a

case 2:

Makefile

.PHONY: clean

clean:
    rm a

environment_1 :
There is only file a

$ make clean

clean a

environment_2 :
There are two file a and clean

$ make clean

clean a

reference:
http://deanjai.blogspot.com/2006/03/makefilevpathphony.html
https://read01.com/zh-tw/NyRx80.html#.XJM-JIURVmU

相关文章:

  • 2022-12-23
  • 2021-10-05
  • 2021-12-17
猜你喜欢
  • 2022-12-23
  • 2022-02-13
  • 2021-09-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案