Tools 2015.10.19 22:52
GNUMake document says
"An argument that contains ‘=’ specifies the value of a variable: ‘v=x’ sets the value of the variable v to x. If you specify a value in this way, all ordinary assignments of the same variable in the makefile are ignored; we say they have been overridden by the command line argument"
This means, value defined as command-line argument has top priority in terms of variable definition.
< Make file >
all: a b
a: PRIV_V := hello_A
b: PRIV_V := hello_B
< Test >
$ export PRIV_V=ENV
$ make PRIV_V=CMD
* Tips : Variable definition in gnumake command line.
Variable definition syntax in the Makefile, is also available as command line argument.
$ make CC=Hello
$ make CC:=Hello
$ make CC+=Hello
'Tools' 카테고리의 다른 글
|[gnumake] Tips and command line variable. (0)||2015.10.19|
|[Gnumake] Organizing my knowledge about 'gnumake' (0)||2013.07.11|
|[GNUMake] deferred & immediate assignment. (0)||2013.07.05|
|[ Emacs ] key-bindings.... (my environment) (0)||2012.03.23|
|Interesting rule of GNU make. (0)||2012.03.23|
|[Tools] Customizing skip list of GNU Global (including regular expression) (0)||2011.07.06|