考虑以下生成文件:
default: foo.o
clean:
rm -f fmake test_second
%.o: %.c
echo This is customized implicit rule
%.o: %.c
echo This is overriden implicit rule
该make
命令的输出是
echo This is overriden implicit rule
This is overriden implicit rule
还行吧。但是,如果生成文件是:
default: foo.o
clean:
rm -f fmake test_second
%.o: %.c
echo This is customized implicit rule
%.o: %.z
echo This is overriden implicit rule
那么make
命令的输出是
echo This is customized implicit rule
This is customized implicit rule
我希望它与第一个示例中的相同。为什么不一样?我在 makefile 的目录中有一个 foo.c 和 foo.z 文件。