【发布时间】:2017-01-12 20:57:33
【问题描述】:
我似乎在 Makefiles 中错误地使用了%。这个简单的 makefile 显示了问题
生成文件:
mylib: mylib-%.dll
mylib-%.dll:
touch mylib-13.dll
myotherlib: myotherlib-13.dll
myotherlib-13.dll:
touch myotherlib-13.dll
输出:
> make mylib
touch mylib-13.dll
> make mylib
touch mylib-13.dll
> make myotherlib
touch myotherlib-13.dll
> make myotherlib
make: Nothing to be done for `myotherlib'.
mylib 总是重新构建(第二个make mylib 调用再次执行touch 命令),而 myotherlib 只构建一次。
为什么会这样,我需要更改什么以便不总是重建 mylib,即第二次调用 make mylib 也返回 make: Nothing to be done for 'mylib'.?
【问题讨论】:
标签: gnu-make