如何强制立即设置特定于目标的变量(第 2 行)?我想要的输出是make
torelease
和make debug
to be debug
。
X = release
debug: X = debug
debug: all
# the rest is included from an external file; cannot be changed
Y := $(X)
BUILD := $(Y)
all:
@echo $(BUILD)
Run Code Online (Sandbox Code Playgroud)