make
- The first target in Makefile is default target.
- @ will prevent printing commands on the screen.
- Variable can be passed into Makefile from shell(export and make command).
- Recursively expanded variables are defined by lines using '='. Simply expanded variables are defined by lines using ':=' or ‘::=’. Conditional assignment operator is '?='.
- Suffix replacement can be done in this way:
foo=a.o b.o c.o
bar:=$(foo:.o=.c) - Override key word make the variable past by make command doesn't work.
either '$(foo)' or '${foo}' is a valid reference to the variable foo. This special significance of '$' is why you must write '$$' to have the effect of a single dollar sign in a file name or recipe.
recursively expanded variables are defined by lines using ‘=’. Simply expanded variables are defined by lines using ‘:=’ or ‘::=’.
There is another assignment operator for variables, ‘?=’. This is called a conditional variable assignment operator, because it only has an effect if the variable is not yet defined.
A substitution reference substitutes the value of a variable with alterations that you specify. It has the form '$(var:a=b)' (or '${var:a=b}') and its meaning is to take the value of the variable var, replace every a at the end of a word with b in that value, and substitute the resulting string.
作者:glob
出处:http://www.cnblogs.com/adera/
欢迎访问我的个人博客:https://blog.globs.site/
本文版权归作者和博客园共有,转载请注明出处。