Update assignment section "=" (#1626)
I think these are more informative and precise examples for assignment expression.
This commit is contained in:
parent
1e966a9ff1
commit
02fed04a43
12
makefile.md
12
makefile.md
|
@ -8,10 +8,13 @@ category: CLI
|
||||||
## Var assignment
|
## Var assignment
|
||||||
|
|
||||||
```makefile
|
```makefile
|
||||||
uglify = $(uglify) # lazy assignment
|
foo = "bar"
|
||||||
compressor := $(uglify) # immediate assignment
|
bar = $(foo) foo # dynamic (renewing) assignment
|
||||||
prefix ?= /usr/local # safe assignment
|
foo := "boo" # one time assignment, $(bar) now is "boo foo"
|
||||||
hello += world # append
|
foo ?= /usr/local # safe assignment, $(foo) and $(bar) still the same
|
||||||
|
bar += world # append, "boo foo world"
|
||||||
|
foo != echo fooo # exec shell command and assign to foo
|
||||||
|
# $(bar) now is "fooo foo world"
|
||||||
```
|
```
|
||||||
|
|
||||||
`=` expressions are only evaluated when they're being used.
|
`=` expressions are only evaluated when they're being used.
|
||||||
|
@ -98,7 +101,6 @@ make
|
||||||
-e, --environment-overrides
|
-e, --environment-overrides
|
||||||
-B, --always-make
|
-B, --always-make
|
||||||
-s, --silent
|
-s, --silent
|
||||||
|
|
||||||
-j, --jobs=N # parallel processing
|
-j, --jobs=N # parallel processing
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue