Makefile显示“make: Nothing to be done for xxxx”的解决方法
2017-05-10 19:40
1111 查看
1. 问题
添加一个Makefile的target的时,总会出现“make: Nothing to be done for `xxxxx’”的提示,而书写语法表面正确。2. 原因
Makefile的target和目录或文件名字冲突。A phony target is one that is not really the name of a file;
rather it is just a name for a recipe to be executed when you make an explicit request.
There are two reasons to use a phony target:
to avoid a conflict with a file of the same name, and to improve performance.
If you write a rule whose recipe will not create the target file, the recipe will be executed every time the target comes up for remaking.
3. 总结
GNU默认Makefile的target是一个文件(或目录)。它会先检测同级目录下是否已存在这个文件,如果存在,则会abort掉make 进程,并提示
make: Nothing to be done for `xxxx’
这种情况需要.PHONY来避免问题的出现,phony的意思是“赝品”,在这里可以形象的理解成“不是文件”。
参考文献:
[1] http://blog.csdn.net/linuxtiger/article/details/7955060 作者: 对象
相关文章推荐
- make: Nothing to be done for `all' 解决方法
- make: Nothing to be done for `all' 解决方法 ---实验2
- make: Nothing to be done for `all' 解决方法
- make: Nothing to be done for 'all' 解决方法(以Ubuntu12.04为例)
- 如何解决make: Nothing to be done for `all' 的方法
- 如何解决make: Nothing to be done for `all' 的方法
- make: Nothing to be done for `all' 解决方法 ---实验2
- makefile 错误 make: Nothing to be done for...
- make: Nothing to be done for `all_modules'.问题解决
- make: Nothing to be done for `all'的解决办法
- 安装过程freetype字体时出现make: Nothing to be done for `unix'.
- 修改.cpp后, 重新make all, 却提示nothing to be done for all
- 编译历程时出现make: Nothing to be done for `all'.
- make: Nothing to be done for `first'
- make: Nothing to be done for 'all'
- QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory
- make: Nothing to be done for 'first'
- make: Nothing to be done for 'first'
- make: Nothing to be done for 'all'
- QT:make: Nothing to be done for `first'和error:QtSql:No such file or directory