【问题标题】:Makefile special characters meaning and useMakefile特殊字符的含义和使用
【发布时间】:2017-05-10 20:28:32
【问题描述】:

Makefile 中的下列字符是什么意思?

$@ , $? , $* , $

我看过一些解释,但我没有完全了解如何准确使用它。

【问题讨论】:

标签: makefile


【解决方案1】:
使用模式和特殊变量
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

【讨论】:

  • 很遗憾,该链接不再有效
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-10
  • 1970-01-01
  • 2020-12-25
  • 1970-01-01
  • 2019-01-12
相关资源
最近更新 更多