2016-12-02 96 views
1

在makefile中我有一些变量。为了更好地理解我添加了一些意见:如何在Makefile中注释一行?

variable1 = value1  #A comment 
variable2 = true  #can be set true or false 
variable3 = foo  #can be foo or bar 

的问题是现在,这两个变量包含给定文本文本和#之间的所有空间。一个简单的回声输出显示问题:

echo "$(variable1) $(variable2) endOfEcho" 
value1  true  endOfEcho 

如何避免空格被解释为变量的文本?

回答

1

用GNU做:

@echo "$(strip $(variable1)) $(strip $(variable2)) endOfEcho" 
value1 true endOfEcho 

@echo "$(variable1) $(variable2) endOfEcho" 
value1  true  endOfEcho 

@echo $(variable1) $(variable2) endOfEcho 
value1 true endOfEcho 
相关问题