【开发笔记】Makefile 中的参数

目录

.PHONY

单词 phony(即 phoney)的意思是:伪造的,假的

If you describe something as phoney, you disapprove of it because it is false rather than genuine.

用法:

.PHONY: clean
    o means the word "clean" doesn't represent a file name in this Makefile;
    o means the Makefile has nothing to do with a file called "clean" 
      in the same directory.

这个符号后面的 target 不会被执行,经常用于之前执行过该 target,之后不想再执行该 target 的时候

假使在 .PHONY 之后执行了其中伪造的 target(这里举例执行了伪造的 clean),那么程序会输出

make: 'clean' is up to date.

来提示该 target 已经被执行过了

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注