Makefile PHONY

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

posted @ 2019-03-21 15:58  wangchangruei  阅读(163)  评论(0编辑  收藏  举报