GNU make的回溯 [英] Backtrace for GNU make

查看:91
本文介绍了GNU make的回溯的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何方法可以使GNU make打印出导致命令执行失败的目标的回溯"目标?在解决在新系统上构建软件的可移植性问题时,我会定期处理大量混淆的makefile,看来这对于make来说应该是一件非常简单的事情,它将大大有助于调试,但是我找不到任何方法可以请求它.我想看到的是这样的:

Is there any way to get GNU make to print a "backtrace" of the targets that led to the command being executed when it fails? I regularly deal with heavily obfuscated makefiles while resolving portability issues building software on a new system, and it seems like this should be an extremely simple thing for make to do that would greatly aid in debugging, but I can't find any way to request it. What I'd like to see is something like:

gcc: error: ...
make[2]: error: gcc ...
make[2]: error building target bar
make[2]: error building dependency bar for target foo
make[1]: error: make -C subdir
make[1]: error building target subdir
make[1]: error building dependency subdir for target all
...

显示失败命令最终如何执行的整个依赖路径.

showing the entire dependency path for how the failed command ended up getting executed.

有什么办法吗?

推荐答案

使用 重制 .它是GNU Make的修补版本,增加了改进的错误报告,以易于理解的方式跟踪执行的能力以及调试器.

Use remake. It is a patched version of GNU Make that adds improved error reporting, the ability to trace execution in a comprehensible way, and a debugger.

这篇关于GNU make的回溯的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆