Makefile特殊字符的含义和用法

时间:2016-12-26 10:53:03

标签: makefile

以下字符在Makefile中的含义是什么?

$ @,$? ,$ *,$< ,$ ^

我已经看到了一些解释,但我并没有完全明白如何使用它。

1 个答案:

答案 0 :(得分:3)

使用模式和特殊变量
When wildcard % appears in the dependency list, it is replaced with 
the same string that was used to perform substitution in the target.

Inside actions we can use:  
    $@ to represent the full target name of the current target  
    $? returns the dependencies that are newer than the current target  
    $* returns the text that corresponds to % in the target     
    $< returns the name of the first dependency 
    $^ returns the names of all the dependencies with space as the delimiter

如需进一步说明,请参阅This github link

相关问题