GNU Make - 内部变量的赋值和改变
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
技术改变世界