1. 赋值和显示
采用$(info $(variable_name))显示内部变量
eg:
FOO=bar $(info $(FOO))
运行结果:
#: make
bar
2. 从命令行外部改变
BUILD_DEBUG := yes
.PHONY: all
all:
@echo BUILD_DEBUG is $(BUILD_DEBUG)
运行结果:
#: make
BUILD_DEBUG is yes
#: make BUILD_DEBUG=no
BUILD_DEBUG is no