我试图从 makefile 中找到一行,并在运行 make clean
时得到以下输出:
rm -f ../../lib/i386/ ../../lib/i386/
rm: cannot remove `../../lib/i386/': Is a directory
上面第一行是命令。第二个是错误。我知道如何修复错误,但我不知道第一行在哪里被调用。
注意:问题很复杂,因为我不完全知道这是来自哪个生成文件。我们有几个遍历多个 makefile 的 include
语句。比如……
include make_example.inc
make_example.inc 包含:
include make_example_example.inc
编辑:我正在寻找一种内置方式来显示来自哪个 makefile 错误的哪一行。 makefile 中是否内置了类似的东西或可以执行此操作的工具?根据情况,使用 find 和 grep 可能会花费很多时间。以上只是一个例子。
最佳答案
如果您使用的是足够新的 GNU make 版本,则可以使用 --trace
标志。
关于c++ - 生成文件 : Is there are a general way to show which line from makefile is causing the error?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25319296/