GNU make manual 翻譯(三十六)

weixin_34262482發表於2012-09-14

繼續翻譯

     You cannot use comments within variable references or function  
     calls: any instance of `#' will be treated literally (rather than 
     as the start of a comment) inside a variable reference or function
     call.                        
                        
     Comments within a recipe are passed to the shell, just as with any 
     other recipe text.  The shell decides how to interpret it: whether 
     or not this is a comment is up to the shell.                        
                        
     Within a `define' directive, comments are not ignored during the
     definition of the variable, but rather kept intact in the value of 
     the variable.  When the variable is expanded they will either be  
     treated as `make' comments or as recipe text, depending on the  
     context in which the variable is evaluated.                        

你不能在 變數或者函式呼叫中使用 註釋,此時任何 #都會被當成有效符號而是註釋起始處來處理。

片段中的註釋將被和片段中的其他部分一起傳遞到shell,shell 將決定如何認識此註釋:它是否被識別為註釋取決於此shell。

在一個 define 指令中,當變數被定義,註釋並不被忽略,被原封不動地保留。而當變數被展開的時候,它或者被識別為 make的註釋,或者被認為是 片段文字的一部分;這取決於具體的變數定義的狀況。

後文待續

相關文章