c++ - 生成文件 : Is there are a general way to show which line from makefile is causing the error?

标签 c++ c makefile

我试图从 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/

相关文章:

c - 在 C 中读取和追加文件

bash - 程序在不同机器上运行的Makefile

compiler-errors - make - 编译 modowa (apache-module) 时出现 fatal error

c++ - -L 和 -l 命令在 Makefile 中不起作用

C 编程类型转换和定点

c++ - pthreads 的 Makefile

c++ - 具有相互独立线程的多线程开销

c++ - QDomDocument 不会插入 QDomElement

c++ - 提高 mmap memcpy 文件读取性能

C++如何获取下一个多字节字符