我有一个带有如下命令的 Makefile:
#Makefile
hello:
echo 'hello'
echo $(TAG)
ifdef TAG
$(warning MYWARNING)
else
$(error MYERROR)
endif
Run Code Online (Sandbox Code Playgroud)
我这样使用它:
# make TAG='1.0' hello
Run Code Online (Sandbox Code Playgroud)
我希望该命令执行 echo 'hello',然后 echo $(TAG) 和 $(warning MYWARNING) 但我得到:
Makefile:17: MYWARNING
Makefile:19: *** MYERROR. Stop.
Run Code Online (Sandbox Code Playgroud)
怎么了?