2016-12-02 2 views
1

メイクファイル内にはいくつかの変数があります。変数が指定されたテキストとテキストと#すべてのスペースが含まれていることを、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 

変数のテキストとして解釈されるように、スペースを避けるために、どのように? GNUで

答えて

1

は作る:

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

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

@echo $(variable1) $(variable2) endOfEcho 
value1 true endOfEcho 
関連する問題