我有一个很大的遗留代码库,包含非常复杂的makefile,有很多变量.有时我需要改变它们,我发现很难弄清楚为什么改变不按照我的预期运作.我想找到的是一个基本上对"make"过程进行逐步调试的工具,我会给它一个目录,我将能够在不同的点看到不同变量的值.处理.没有任何调试标志似乎能告诉我我想要什么,虽然我可能会遗漏一些东西.有谁知道这样做的方法?
你有没有看过跑步make -n
和make -np
大佬的输出make -nd
?
你使用的是最新版本gmake
吗?
你有没有看过关于调试Makefiles的免费章节,可以在O'Reilly的网站上找到他们出色的书"使用GNU Make管理项目"(亚马逊链接).
我相信翻拍是你想要的.
从主页:
remake是GNU make实用程序的修补和现代化版本,它增加了改进的错误报告,以易于理解的方式跟踪执行的能力以及调试器.
它有类似gdb的界面,并且在(x)emacs中受mdb-mode支持,这意味着破坏,手表等.如果你不喜欢(x)emacs ,那就是 DDD
从make命令行选项的手册页:
-n, --just-print, --dry-run, --recon Print the commands that would be executed, but do not execute them. -d Print debugging information in addition to normal processing. The debugging information says which files are being considered for remaking, which file-times are being compared and with what results, which files actually need to be remade, which implicit rules are considered and which are applied--- everything interesting about how make decides what to do. --debug[=FLAGS] Print debugging information in addition to normal processing. If the FLAGS are omitted, then the behaviour is the same as if -d was specified. FLAGS may be: 'a' for all debugging output same as using -d, 'b' for basic debugging, 'v' for more verbose basic debugging, 'i' for showing implicit rules, 'j' for details on invocation of commands, and 'm' for debugging while remaking makefiles.