如何debug makefile文件
来源:互联网 发布:clint eastwood 知乎 编辑:程序博客网 时间:2024/06/07 01:22
27.11 Debugging Make Rules
The rules and dependency trees generated by automake
can get rather complex, and leave the developer head-scratching when things don’t work as expected. Besides the debug options provided by the make
command (see Options Summary inThe GNU Make Manual), here’s a couple of further hints for debugging makefiles generated by automake
effectively:
- If less verbose output has been enabled in the package with the use of silent rules (see Automake Silent Rules), you can use
make V=1
to see the commands being executed. make -n
can help show what would be done without actually doing it. Note however, that this will still executecommands prefixed with ‘+’, and, when using GNUmake
, commands that contain the strings ‘$(MAKE)’ or ‘${MAKE}’ (see Instead of Execution in The GNU Make Manual). Typically, this is helpful to show what recursive rules would do, but it means that, in your own rules, you should not mix such recursion with actions that change any files.8Furthermore, note that GNUmake
will update prerequisites for the Makefile file itself even with -n (see Remaking Makefiles in The GNU Make Manual).make SHELL="/bin/bash -vx"
can help debug complex rules. See The Make Macro SHELL in The Autoconf Manual, for some portability quirks associated with this construct.echo 'print: ; @echo "$(VAR)"' | make -f Makefile -f - print
can be handy to examine the expanded value of variables. You may need to use a target other than ‘print’ if that is already used or a file with that name exists.- http://bashdb.sourceforge.net/remake/ provides a modified GNU
make
command calledremake
that copes with complex GNUmake
-specific Makefiles and allows to trace execution, examine variables, and call rules interactively, much like a debugger.
here are three command-line options I find most useful for debugging:
--just-print
--print-data-base
--warn-undefined-variables
0 0
- 如何debug makefile文件
- Makefile,如何传递宏定义DEBUG
- Makefile,如何传递宏定义DEBUG
- 如何写 makefile文件
- 如何写 Makefile文件
- 如何写Makefile文件
- 如何写Makefile文件
- 如何写Makefile文件
- 如何编写Makefile文件
- 如何写makefile文件
- 如何写Makefile文件
- 如何编写makefile文件
- 如何编写makefile文件
- Makefile Debug:
- 如何生存debug.keystore文件
- makefile如何指定编译文件
- Linux 如何写makefile文件
- 如何自动生成Makefile文件
- CListCtrl控件选中并高亮显示
- DedeCMS自学教程10:文档内容末尾加“当前文档页面地址”和“转载说明”
- UINavigationController、UITabBarController 支持屏幕自动旋转问题
- 待机界面-点击亮度调节快捷键,在LCD亮度渐变时有闪屏现象
- 为什么会有extern "C"这样的规定?
- 如何debug makefile文件
- ecshop中点击分类时如果有子分类显示子分类,没有的话就不显示
- 安全加密方案
- iOS 17个常用代码整理
- LitePal学习总结 (五)
- php优化的小细节2
- 对二分查找程序的一次测试
- Linux进程同步之POSIX信号量
- 类继承与原型继承