make

  1. The first target in Makefile is default target.
  2. @ will prevent printing commands on the screen.
  3. Variable can be passed into Makefile from shell(export and make command).
  4. Recursively expanded variables are defined by lines using '='. Simply expanded variables are defined by lines using ':=' or ‘::=’. Conditional assignment operator is '?='.
  5. Suffix replacement can be done in this way:
    foo=a.o b.o c.o
    bar:=$(foo:.o=.c)
  6. 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.

 

posted @ 2017-06-09 16:19  glob  阅读(220)  评论(0编辑  收藏  举报