当前位置: 技术问答>linux和unix
makefile中.DEFAULT的疑问
来源: 互联网 发布时间:2015-07-27
本文导语: GNU make 手册上的说明如下: The commands specified for .DEFAULT are used for any target for which no rules are found (either explicit rules or implicit rules). If .DEFAULT commands are specified, every file mentioned as a dependency, but...
GNU make 手册上的说明如下:
The commands specified for .DEFAULT are used for any target for which no rules are found (either explicit rules or implicit rules).
If .DEFAULT commands are specified, every file mentioned as a dependency, but not as a target in a rule, will have these commands executed on its behalf.
看不懂
如果这样一个makefile
%:
@echo 1 doing
.DEFAULT:test
test:
@echo lgnq doing
何时会执行.DEFAULT呢?
The commands specified for .DEFAULT are used for any target for which no rules are found (either explicit rules or implicit rules).
If .DEFAULT commands are specified, every file mentioned as a dependency, but not as a target in a rule, will have these commands executed on its behalf.
看不懂
如果这样一个makefile
%:
@echo 1 doing
.DEFAULT:test
test:
@echo lgnq doing
何时会执行.DEFAULT呢?
|
this is an easy problem, the english explaination just tell you if you have rule, you can get the result , if you no rule, you will get the default, you can try it by yourself, then you can make sense!