如果make想要构建像 xyz.o 这样的文件,那么's no explicit rule for that target, it will look at the implicit (pattern and suffix) rules to try to find a rule. If there'是一个匹配目标的规则,并且make知道如何构建所有先决条件,那么规则将匹配,make将尝试使用它 .
如果make可以't build one or more of the prerequisites then that implicit rule doesn'匹配并且make将继续寻找不同的隐式规则 . 这不是错误!在目标文件的特定情况下,make具有内置规则,这些规则知道如何从C源文件,C源文件,FORTRAN源文件,汇编文件等构建 .o . 它们都具有 %.o 的目标模式,但只有一个他们(通常)将匹配......其他人被抛弃但这不是错误 .
1 回答
如果make想要构建像
xyz.o
这样的文件,那么's no explicit rule for that target, it will look at the implicit (pattern and suffix) rules to try to find a rule. If there'是一个匹配目标的规则,并且make知道如何构建所有先决条件,那么规则将匹配,make将尝试使用它 .如果make可以't build one or more of the prerequisites then that implicit rule doesn'匹配并且make将继续寻找不同的隐式规则 . 这不是错误!在目标文件的特定情况下,make具有内置规则,这些规则知道如何从C源文件,C源文件,FORTRAN源文件,汇编文件等构建
.o
. 它们都具有%.o
的目标模式,但只有一个他们(通常)将匹配......其他人被抛弃但这不是错误 .如果在隐式规则搜索结束时没有规则与目标匹配,但目标存在,则没有问题:make假定此文件是不应构建的源文件(如
xyz.c
或xyz.h
) ,只是使用它 .如果在搜索完所有规则但未找到匹配项且目标文件(
xyz.o
)不存在之后,那么您有错误并且make将报告它不知道如何构建该目标 .