调试Makefile的工具

调试Makefile的工具

Tool for debugging makefiles

我有一个大型的旧版代码库,其中包含非常复杂的makefile和许多变量。 有时我需要更改它们,但我发现很难弄清为什么更改未按我期望的方式工作。 我想找到的是一个基本上可以对" make"过程进行逐步调试的工具,在这里可以给它一个目录,并且我可以在不同位置查看不同变量的值。 处理。 尽管可能会丢失某些内容,但所有要使的调试标志似乎都没有告诉我我想要什么。 有人知道这样做的方法吗?


您是否一直在查看运行make -nmake -np以及biggie make -nd的输出?

您是否正在使用gmake的较新版本?

您是否看过O'Reilly网站上免费的关于调试Makefile的章节,其中包含其出色的著作"使用GNU Make管理项目"(Amazon Link)。


我确定重拍是您想要的。

从首页:

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

它具有类似gdb的界面,并且(x)emacs中的mdb-mode支持,这意味着断点,手表等。如果您不喜欢(x)emacs,则还有DDD


在手册页上的make命令行选项中:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-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.

我不知道有什么特定标志可以完全满足您的要求,但是

1
--print-data-base

听起来可能有用。


1
remake --debugger all

更多信息https://vimeo.com/97397484

https://github.com/rocky/remake/wiki/安装


在http://gmd.sf.net上有一个GNU make调试器项目,看起来很有用。 gmd支持的主要功能是断点,它可能比步进更有用。要使用此功能,请从http://gmd.sf.net下载gmd,从http://gmsl.sf.net下载gmsl,然后在makefile中执行" include gmd"。


推荐阅读

    开发linux命令工具?

    开发linux命令工具?,系统,工具,环境,状态,平台,设计,数据,电脑,中小企业,标

    linux命令联想工具?

    linux命令联想工具?,地址,工作,系统,工具,状态,标准,信息,命令,目录,左下角,L

    linux命令工具怎么用?

    linux命令工具怎么用?,地址,系统,工作,单位,工具,密码,服务,命令,处分,基础,

    linux变量是一个命令?

    linux变量是一个命令?,系统,信息,变量,名称,官网,地址,环境,代码,地方,命令,$

    linux命令行截图工具?

    linux命令行截图工具?,工具,电脑,软件,系统,截图,网站,工作,环境,暂停,命令,L

    linux命令工具教程?

    linux命令工具教程?,系统,工具,信息,基础,基础知识,代码,在线,地址,项目,服

    linux命令行渗透工具?

    linux命令行渗透工具?,系统,发行,网络,工具,信息,地址,管理,数据,工程,中国,

    linux中变量取余命令?

    linux中变量取余命令?,地址,工作,系统,数据,信息,命令,分析,目录,控制台,文

    linux卸载工具命令?

    linux卸载工具命令?,软件,系统,工具,名称,电脑,信息,命令,终端,程序,提示符,l

    linux调试终端命令?

    linux调试终端命令?,系统,工作,地址,首页,电脑,终端,命令,标准,信息,基础,求L

    linux命令流程图工具?

    linux命令流程图工具?,软件,工具,在线,网站,电脑,流程图,网络,名称,系统,首

    linux命令输入工具?

    linux命令输入工具?,系统,工具,工作,地址,信息,命令,时间,管理,环境,状态,怎

    加载变量的linux命令?

    加载变量的linux命令?,工具,系统,名称,环境变量,环境,命令,用户,文件,变量,

    linux脚本调试的命令?

    linux脚本调试的命令?,工作,系统,管理,命令,地址,标准,脚本,底部,代码,官网,l

    远程linux命令行工具?

    远程linux命令行工具?,工具,软件,平台,灵活,系统,代码,图片,网络,环境,管理,l

    linux命令行补全工具?

    linux命令行补全工具?,系统,工具,软件,信息,智能,命令,检测,地址,不了,环境,w

    linux命令调试模式?

    linux命令调试模式?,系统,工作,信息,地址,工程,命令,工具,环境,设备,地方,lin

    linux调试驱动的命令?

    linux调试驱动的命令?,系统,网络,官网,百度,地址,下来,第一,官方网站,软件,

    linux命令调试过程?

    linux命令调试过程?,代码,通用,地方,信息,系统,程序,进程,命令,编辑,断点,如

    linux变量赋值命令?

    linux变量赋值命令?,标准,数据,数字,时间,系统,名称,变量,赋值,代码,环境,lin