Makefile中的几个调试方法
来源:互联网 发布:手机淘宝怎么找店铺 编辑:程序博客网 时间:2024/05/29 11:29
1,使用info/warning/error增加调试信息
方法1: $(info, "here add the debug info")
但是此不能打印出.mk的行号
方法2: $(warning, "here add the debug info")
方法3: $(error "error: this will stop the compile")
这个可以停止当前makefile的编译
方法4: 打印变量的值
$(info, $(TARGET_DEVICE) )
关于warning函数:
warning函数非常适合用来调试难以捉摸的makefile。因为warning函数会被扩展成空字符串,所以它可以放在makefile 中的任何地方:开始的位置、工作目标或必要条件列表中以
及命令脚本中。这让你能够在最方便查看变量的地方输出变量的值。例如:
$(warning A top-level warning)
FOO := $(warning Right-hand side of a simple variable)bar
BAZ = $(warning Right-hand side of a recursive variable)boo
$(warning A target)target: $(warning In a prerequisite list)makefile
$(BAZ)
$(warning In a command script)
ls
$(BAZ):
这会产生如下的输出:
$ make
makefile:1: A top-level warning
makefile:2: Right-hand side of a simple variable
makefile:5: A target
makefile:5: In a prerequisite list
makefile:5: Right-hand side of a recursive variable
makefile:8: Right-hand side of a recursive variable
makefile:6: In a command script
ls
makefile
请注意,warning函数的求值方式是按照make标准的立即和延后求值算法。虽然对BAZ的赋值动作中包含了一个warning函数,但是直到BAZ在必要条件列表中被求值后,这个信息才
会被输出来。
“可以在任何地方安插warning调用”的这个特性,让它能够成为一个基本的调试工具。
2,使用echo增加调试信息(echo只能在target:后面的语句中使用,且前面是个TAB)
方法1: @echo "start the compilexxxxxxxxxxxxxxxxxxxxxxx"
方法2: @echo $(files)
################################################################################
原文链接:http://blog.csdn.net/wlqingwei/article/details/44459139
http://blog.csdn.net/mevin/article/details/6618546
- Makefile中的几个调试方法
- Makefile中的几个调试方法
- Makefile中的几个调试方法
- Makefile常用调试方法
- Makefile中的几个自动化变量
- makefile中的几个赋值符号
- windbg几个调试方法
- Android makefile文件调试方法
- 关于Makefile中的几个=号
- 调试ffmpeg与Makefile中的STRIP
- squid 安装调试过程中的几个常用命令
- 串口GSM MODEM调试中的几个细节
- Squid 安装调试过程中的几个常用命令
- 驱动中的调试方法
- jsp中的几个跳转方法
- Hibernate DAO中的几个方法
- HttpServlet中的几个常用方法
- Canvas中的几个重要方法
- linux网络基本之ip命令
- win7 设置启用remote control 设置方法
- 剑指offer——第一个只出现一次的字符
- 配置参数详解(主要是%ZOOKEEPER_HOME%/conf/zoo.cfg文件)
- 微信公众号个性化菜单
- Makefile中的几个调试方法
- tjut 4631
- 318. Maximum Product of Word Lengths
- 10011---CentOS ping: unknown host 解决方法
- [2016ACM多校] HDU5758 贪心 搜索
- Hibernate一对多单向,多对一单向,多对一双向关联
- opencv直方图该怎么画
- 结合源码和日志分析 mesos agent recover 过程
- STM32 RS485通信