博客
关于我
Makefile CMakeList.txt文件打印调试
阅读量:352 次
发布时间:2019-03-04

本文共 612 字,大约阅读时间需要 2 分钟。

Makefile 开发指南

1. Makefile 中的警告

在 Makefile 中,$(warning) 任务可以灵活选择打印相关变量。它会在终端输出行号及信息,但不会终止编译过程。

示例:

$(warning xxxxx)  # 打印固定信息$(warning $(XXX))  # 打印变量值

2. Makefile 中的报错

$(error) 任务类似于 $(warning),但会终止编译过程。

示例:

$(error xxxxx)  # 打印固定信息$(error $(XXX))  # 打印变量值

3. CMakeList.txt 中的信息输出

在 CMakeList.txt 中,可以使用 message() 函数输出信息。

示例:

message("xxxxx")  # 打印固定信息message(${XXX})  # 打印变量值

4. 调试确认 Makefile 被包含两次

在需要调试的文件中,可以通过自定义变量判断 Makefile 是否被包含。

示例:

ifeq ($(LGDEBUG), )  $(warning enter component.mk first time)  LGDEBUG = COMPONENT_DEBUGelse  $(error enter component.mk second time)endif

这个方法可以帮助开发者确认 Makefile 是否被正确包含。

转载地址:http://evkr.baihongyu.com/

你可能感兴趣的文章
python3 mysql 封装多表_python3 mysql-多表查询
查看>>
python3 mysql8_Python MySQL8.0 错误:authentication plugin 'calling_sha2_password' is not supported....
查看>>
python3 robotframework+pycharm框架搭建
查看>>
Python3 tutorial day3
查看>>
python3 week4
查看>>
Python3 创建数组
查看>>
python3 套接字异常(a byte-like object is required not str)
查看>>
python3 实现用户三次输入错误记录黑名单并对该用户登录锁定-day1
查看>>
python3 文本变图片
查看>>
Python3 查看 com 组件的属性
查看>>
python3 案例分享--发邮件
查看>>
python3 模板库_Python3 标准库概览_Python教程_我爱模板网 - 提供下载各种免费建站资源,免费网站模板,免费网页特效,让你爱上建站!...
查看>>
Python3 求最大/小值及索引值 Numpy
查看>>
python3+django使用celery执行某些任务失败的解决方案
查看>>
Python3+Requests+Unittest实战系列【一】
查看>>
python3+requests+unittest实战系列【一】
查看>>
python3+requests+unittest实战系列【二】
查看>>
Python3+Requests+Unittest实战系列【二】
查看>>
python3----ASCII
查看>>
Python3-selenium自动化测试框架,结合HTMLTestRunner测试报告!
查看>>