如何打印makefile中的值
我有一个要调试的make文件。我有一个结构如下:如何打印makefile中的值,makefile,gnu-make,Makefile,Gnu Make,我有一个要调试的make文件。我有一个结构如下: ifeq ($(CC_VER),4.3) error "I am here" AR = ar6x qwe CSL_LIBDIR = $(CC_DIR)\lib CSL_INCDIR = $(CC_DIR)\include else error "Please check that commands and include/lib path are correct for your version o
ifeq ($(CC_VER),4.3)
error "I am here"
AR = ar6x qwe
CSL_LIBDIR = $(CC_DIR)\lib
CSL_INCDIR = $(CC_DIR)\include
else
error "Please check that commands and include/lib path are correct for your version of CC compiler"
endif
但它不起作用。从batchfile运行此makefile,该文件将CC\u版本设置为:
set CC_VER= 4.3
我想找到一种打印出抄送版本的方法,这样我就可以找到if不起作用的原因
还有,如何生成错误?错误“消息”不起作用
我正在使用Gmake。您可以使用$(错误文本…
构造错误。当消息为text
时,它会生成致命错误,如下所示:
$(error Please check that commands and include/lib path are correct for your version of CC compiler)
类似地,您也可以使用$(info text…
构造来提供信息,如中所示
$(info CC_VER has the value "$(CC_VER)")
有关文档,请参阅
如果您只是想快速检查变量的值,还可以使用-p
或--print database
选项来make
,这将打印所有规则和变量值
if
语句失败,因为set CC\u VER
命令中的=
和4.3
之间有空格。此空格保留在变量值中,因此$(CC\u VER)
不等于4.3
,而是等于4.3