注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

Mr.Right

不顾一切的去想,于是我们有了梦想。脚踏实地的去做,于是梦想成了现实。

 
 
 

日志

 
 
关于我

人生一年又一年,只要每年都有所积累,有所成长,都有那么一次自己认为满意的花开时刻就好。即使一时不顺,也要敞开胸怀。生命的荣枯并不是简单的重复,一时的得失不是成败的尺度。花开不是荣耀,而是一个美丽的结束,花谢也不是耻辱,而是一个低调的开始。

网易考拉推荐

GNU make 参考--写高质量make file必备  

2012-11-07 12:46:46|  分类: 编程 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

Here is a summary of the directives GNU make recognizes:

define variable
endef
Define a multi-line, recursively-expanded variable.
See section Defining Canned Command Sequences.
ifdef variable
ifndef variable
ifeq (a,b)
ifeq "a" "b"
ifeq 'a' 'b'
ifneq (a,b)
ifneq "a" "b"
ifneq 'a' 'b'
else
endif
Conditionally evaluate part of the makefile.
See section Conditional Parts of Makefiles.
include file
Include another makefile.
See section Including Other Makefiles.
override variable = value
override variable := value
override variable += value
override define variable
endef
Define a variable, overriding any previous definition, even one from the command line.
See section The override Directive.
export
Tell make to export all variables to child processes by default.
See section Communicating Variables to a Sub-make.
export variable
export variable = value
export variable := value
export variable += value
unexport variable
Tell make whether or not to export a particular variable to child processes.
See section Communicating Variables to a Sub-make.
vpath pattern path
Specify a search path for files matching a `%' pattern.
See section The vpath Directive.
vpath pattern
Remove all search paths previously specified for pattern.
vpath
Remove all search paths previously specified in any vpath directive.

Here is a summary of the text manipulation functions (see section Functions for Transforming Text):

$(subst from,to,text)
Replace from with to in text.
See section Functions for String Substitution and Analysis.
$(patsubst pattern,replacement,text)
Replace words matching pattern with replacement in text.
See section Functions for String Substitution and Analysis.
$(strip string)
Remove excess whitespace characters from string.
See section Functions for String Substitution and Analysis.
$(findstring find,text)
Locate find in text.
See section Functions for String Substitution and Analysis.
$(filter pattern...,text)
Select words in text that match one of the pattern words.
See section Functions for String Substitution and Analysis.
$(filter-out pattern...,text)
Select words in text that do not match any of the pattern words.
See section Functions for String Substitution and Analysis.
$(sort list)
Sort the words in list lexicographically, removing duplicates.
See section Functions for String Substitution and Analysis.
$(dir names...)
Extract the directory part of each file name.
See section Functions for File Names.
$(notdir names...)
Extract the non-directory part of each file name.
See section Functions for File Names.
$(suffix names...)
Extract the suffix (the last `.' and following characters) of each file name.
See section Functions for File Names.
$(basename names...)
Extract the base name (name without suffix) of each file name.
See section Functions for File Names.
$(addsuffix suffix,names...)
Append suffix to each word in names.
See section Functions for File Names.
$(addprefix prefix,names...)
Prepend prefix to each word in names.
See section Functions for File Names.
$(join list1,list2)
Join two parallel lists of words.
See section Functions for File Names.
$(word n,text)
Extract the nth word (one-origin) of text.
See section Functions for File Names.
$(words text)
Count the number of words in text.
See section Functions for File Names.
$(firstword names...)
Extract the first word of names.
See section Functions for File Names.
$(wildcard pattern...)
Find file names matching a shell file name pattern (not a `%' pattern).
See section The Function wildcard.
$(shell command)
Execute a shell command and return its output.
See section The shell Function.
$(origin variable)
Return a string describing how the make variable variable was defined.
See section The origin Function.
$(foreach var,words,text)
Evaluate text with var bound to each word in words, and concatenate the results.
See section The foreach Function.

Here is a summary of the automatic variables. See section Automatic Variables, for full information.

$@
The file name of the target.
$%
The target member name, when the target is an archive member.
$<
The name of the first dependency.
$?
The names of all the dependencies that are newer than the target, with spaces between them. For dependencies which are archive members, only the member named is used (see section Using make to Update Archive Files).
$^
$+
The names of all the dependencies, with spaces between them. For dependencies which are archive members, only the member named is used (see section Using make to Update Archive Files). The value of $^ omits duplicate dependencies, while $+ retains them and preserves their order.
$*
The stem with which an implicit rule matches (see section How Patterns Match).
$(@D)
$(@F)
The directory part and the file-within-directory part of $@.
$(*D)
$(*F)
The directory part and the file-within-directory part of $*.
$(%D)
$(%F)
The directory part and the file-within-directory part of $%.
$(<D)
$(<F)
The directory part and the file-within-directory part of $<.
$(^D)
$(^F)
The directory part and the file-within-directory part of $^.
$(+D)
$(+F)
The directory part and the file-within-directory part of $+.
$(?D)
$(?F)
The directory part and the file-within-directory part of $?.

These variables are used specially by GNU make:

MAKEFILES
Makefiles to be read on every invocation of make.
See section The Variable MAKEFILES.
VPATH
Directory search path for files not found in the current directory.
See section VPATH: Search Path for All Dependencies.
SHELL
The name of the system default command interpreter, usually `/bin/sh'. You can set SHELL in the makefile to change the shell used to run commands. See section Command Execution.
MAKE
The name with which make was invoked. Using this variable in commands has special meaning. See section How the MAKE Variable Works.
MAKELEVEL
The number of levels of recursion (sub-makes).
See section Communicating Variables to a Sub-make.
MAKEFLAGS
The flags given to make. You can set this in the environment or a makefile to set flags.
See section Communicating Options to a Sub-make.
SUFFIXES
The default list of suffixes before make reads any makefiles.  

Index of Concepts

#

  • # (comments), in commands
  • # (comments), in makefile
  • #include
  • $

  • $, in function call
  • $, in rules
  • $, in variable name
  • $, in variable reference
  • %

  • %, in pattern rules
  • %, quoting in static pattern
  • %, quoting in patsubst
  • %, quoting in vpath
  • %, quoting with \ (backslash), %, quoting with \ (backslash), %, quoting with \ (backslash)
  • *

  • * (wildcard character)
  • +

  • +, and define
  • +=   Often it is useful to add more text to the value of a variable already defined. You do this with a line containing `+='
  •   评论这张
     
    阅读(607)| 评论(0)
    推荐 转载

    历史上的今天

    在LOFTER的更多文章

    评论

    <#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
     
     
     
     
     
     
     
     
     
     
     
     
     
     

    页脚

    网易公司版权所有 ©1997-2016