有没有Make调试器?我需要弄清楚别人的 makefile

发布于 2024-09-18 07:15:24 字数 188 浏览 6 评论 0原文

我需要向非常复杂的多层 makefile(大量包含文件、大量目标、大量变量)添加一些功能,该文件是由其他人编写的,当然,这些人已经不再在公司工作了。这里有些人了解其中的一些,但不了解全部。

是否有一个 Make 调试器,我可以单步执行它,或者是否有某种等效的方法来跟踪编译流经的许多文件和目标的执行?或者有其他方法可以了解这个东西是如何工作的吗?

I need to add some capabilities to very complex, multi-layered makefile (lots of include files, lots of targets, lots of variables) that was written by someone else who of course is no longer with the company. There are some folks here who understand some of it, but not the whole thing.

Is there a Make debugger where I can single-step through it, or some equivalent way to follow the execution through the many files and targets that a compile flows through? Or is there some other way to get a handle on how this thing works?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浮生未歇 2024-09-25 07:15:24

GNU Make 有各种选项用于打印一些调试信息运行时的信息。 -d 会打印出一大堆调试信息;也许太多了,也许不是你需要的,但你可以尝试筛选一下。还有一些选项,例如用于进行空运行的 -n、用于打印规则数据库的 -p、用于打印目录的 -w您可以帮助跟踪复杂的递归生成中的问题,并使用 --warn-undefined-variables 来跟踪变量的某些问题。

如果这些都不起作用,您可能需要尝试 Remake,它声称是经过修补的 GNU make用调试器。我还没有使用过它,但是从文档来看,它看起来可能有帮助你出去了,它还有一些关于尝试追踪 Makefile 中的错误的更多建议。

GNU Make has various options for printing out some debugging information while running. -d will print out a whole lot of debugging information; perhaps too much, and perhaps not what you need, but you might try sifting through that. There are also options like -n for doing a dry run, -p for printing the database of rules, -w for printing out which directory you're in to help track down issues in complicated recursive makes, and --warn-undefined-variables for tracking down certain problems with variables.

If none of that works, you might want to try Remake, which claims to be a patched GNU make with a debugger. I haven't used it, but from the documentation, it looks like it might help you out, and it has some more advice on trying to track down bugs in Makefiles.

末蓝 2024-09-25 07:15:24

您可能想看看这篇文章 http://oreilly.com/catalog/make3/ book/ch12.pdf(Oreilly 的“使用 GNU Make 管理项目,第三版”中的“调试 Makefiles”一章)

You might want to look at this article http://oreilly.com/catalog/make3/book/ch12.pdf (A chapter "Debugging Makefiles" from Oreilly's "Managing Projects with GNU Make, Third Edition")

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文