我在Makefile中有以下内容:
ifndef MYVAR
$(error "MYVAR is not set")
else
$(warning "MYVAR is set to [$(MYVAR)]")
ifeq ($(MYVAR),"abc")
$(error "Value is known.")
else
$(error "Not known.")
endif
endif
我在调用make时设置了MYVAR:
MYVAR=abc make
我原本希望看到"价值已知。"但我得到以下内容:
Makefile:4: "MYVAR is set to [abc]"
Makefile:8: *** "Not known.". Stop.
有人可以告诉我ifeq声明有什么问题吗?
答案 0 :(得分:0)
@melpomene在评论中回答了问题。像往常一样,报价错误。
ifeq ($(MYVAR),abc) or MYVAR='"abc"' make