更新时间:2021-12-05 21:38:18
问题是echo
属于外壳程序; Make可以在命令中将其传递给Shell,但是Make无法执行它.使用info
代替:
The problem is that echo
belongs to the shell; Make can pass it to the shell in a command, but Make cannot execute it. Use info
instead:
ifdef CATEGORY
$(info CATEGORY defined)
else
$(info CATEGORY undefined)
endif
如果您希望规则是有条件的:
If you want the rules to be conditional:
ifdef CATEGORY
ifdef TEST
$(CATEGORY):
whatever
else
$(info TEST not defined)
else
$(info CATEGORY not defined)
endif