当我在查找 makefile 中使用
根据原帖,make target1 应该会抛出一个错误,请解释一下。
一些信息:
.PHONY
的用法时,我看到了这个帖子,它说了以下内容:
我在一个 makefile 文件中尝试了这篇文章中提到的例子,但是并没有像原帖中提到的那样显示任何错误。请问有谁能详细解释一下吗?.PHONY 还允许您拥有没有相关规则的目标
该 makefile 文件如下:
target1: dostuff
.PHONY: target2
target2: dostuff
dostuff:
@echo "Stuff gets done!!!!"
输出
[sourav@titan temp]$ make target1
Stuff gets done!!!!
[sourav@titan temp]$ make target2
Stuff gets done!!!!
[sourav@titan temp]$ make
Stuff gets done!!!!
[sourav@titan temp]$
根据原帖,make target1 应该会抛出一个错误,请解释一下。
一些信息:
[sourav@titan temp]$ uname -r
2.6.18-194.el5PAE
[sourav@titan temp]$ make --version
GNU Make 3.81
[sourav@titan temp]$