码迷,mamicode.com
首页 > 其他好文 > 详细

Makefile 知识点

时间:2014-06-28 10:50:20      阅读:192      评论:0      收藏:0      [点我收藏+]

标签:get   os   art   name   for   c   

$@

$@ is the name of the target.

$?

The $? macro stores the list of dependents more recent than the target (i.e., those that have changed since the last time make was invoked for the given target).

$^

$^ gives you all dependencies, regardless of whether they are more recent than the target. Duplicate names, however, will be removed. This might be useful if you produce transient output (such as displaying a result to the screen rather than saving it to a file).

$+

$+ is like $^, but it keeps duplicates and gives you the entire list of dependencies in the order they appear.

$<

If you only need the first dependency, then $< is for you. Using $< can be safer than relying on $^ when you have only a single dependency that needs to appear in the commands executed by the target. If you start by using $^ when you have a single dependency, if you then add a second, it may be problematic, whereas if you had used $< from the beginning, it will continue to work. (Of course, you may want to have all dependencies show up. Consider your needs carefully.)

 

 

Makefile 知识点,布布扣,bubuko.com

Makefile 知识点

标签:get   os   art   name   for   c   

原文地址:http://www.cnblogs.com/welhzh/p/3798984.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!