博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Makefile CMakeList.txt文件打印调试
阅读量:348 次
发布时间:2019-03-04

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

1. Makefile

可以根据需要灵活选择warning或者error打印相关变量

1.1 警告

$(warning xxxxx)  $(warning  $(XXX))

在终端输出行号,及打印信息,不会终止编译过程

1.2 报错

$(error xxxxx)  $(error $(XXX))

在终端输出行号,及打印信息,同时终止编译过程。

2. CMakeList.txt

message("xxxxx")  message(${XXX})

类似Makefile的warning功能,不会终止编译。

3. 调试确认Makefile被include了两次

在需要调试的文件头部加类似以下的信息:

LGDEBUG为自定义的与Makefile中其他变量不重名的变量,component.mk为我要调试的Makefile。

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

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

你可能感兴趣的文章