博客
关于我
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/

你可能感兴趣的文章
Pinterest 大规模缓存集群的架构剖析
查看>>
pintos project (2) Project 1 Thread -Mission 1 Code
查看>>
PinYin4j库的使用
查看>>
PIP
查看>>
pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
查看>>
pip install mysqlclient报错
查看>>
pip install 出现报asciii码错误的解决
查看>>
pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding‘ 在尝试安装新软件包时
查看>>
pip 下载慢
查看>>
pip 升级报错AttributeError: ‘NoneType’ object has no attribute ‘bytes’
查看>>
pip 安装opencv-python卡死
查看>>
pip 安装出现异常
查看>>
Pip 安装失败:需要 SSL
查看>>
Pip 安装挂起
查看>>
pip 或 pip3 为 Python 3 安装包?
查看>>
pip 文件损坏导致 pip无法使用 报错 ImportError: cannot import name 'main' from 'pip._int
查看>>
pip/pip3更换国内源
查看>>
pip3 install PyQt5 --user 失败
查看>>
pip3命令全解析:Python3包管理工具的详细使用指南
查看>>
pip3安装命令重复创建文件‘/tmp/pip-install-xxxxx/package‘失败
查看>>