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

 

posted @ 2015-09-29 11:28  Master HaKu  阅读(323)  评论(0编辑  收藏  举报