mby*_*215 62 debugging makefile
我有一个很大的遗留代码库,包含非常复杂的makefile,有很多变量.有时我需要改变它们,我发现很难弄清楚为什么改变不按照我的预期运作.我想找到的是一个基本上对"make"过程进行逐步调试的工具,我会给它一个目录,我将能够在不同的点看到不同变量的值.处理.没有任何调试标志似乎能告诉我我想要什么,虽然我可能会遗漏一些东西.有谁知道这样做的方法?
Rob*_*lls 62
你有没有看过跑步make -n和make -np大佬的输出make -nd?
你使用的是最新版本gmake吗?
你有没有看过关于调试Makefiles的免费章节,可以在O'Reilly的网站上找到他们出色的书"使用GNU Make管理项目"(亚马逊链接).
Gur*_*ruM 17
从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.
Run Code Online (Sandbox Code Playgroud)