本文共 500 字,大约阅读时间需要 1 分钟。
可以根据需要灵活选择
warning
或者error
打印相关变量
$(warning xxxxx) $(warning $(XXX))
在终端输出行号,及打印信息,不会终止编译过程
$(error xxxxx) $(error $(XXX))
在终端输出行号,及打印信息,同时终止编译过程。
message("xxxxx") message(${XXX})
类似Makefile的warning功能,不会终止编译。
在需要调试的文件头部加类似以下的信息:
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/