diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/development/make.md | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/development/make.md b/src/development/make.md index dcc9fe6..1ebe98e 100644 --- a/src/development/make.md +++ b/src/development/make.md @@ -54,7 +54,7 @@ bbb: ``` Running above `Makefile` gives: -```test +```text @ = foobar < = aaa ^ = aaa bbb @@ -72,6 +72,25 @@ Running above `Makefile` gives: Variables related to filesystem paths: - `$(CURDIR)`: Path of current working dir after using `make -C path` +## Arguments + +Arguments specified on the command line *override* ordinary variable +assignments in the makefile ([overriding variables][make-var-override]). + +```make +VAR = abc +all: + @echo VAR=$(VAR) +``` + +```text +# make +VAR=abc + +# make VAR=123 +VAR=123 +``` + ## Useful functions ### Substitution references @@ -108,3 +127,5 @@ Resolve each file name as canonical path. ```make $(realpath fname1 fname2 ..) ``` + +[make-var-override]: https://www.gnu.org/software/make/manual/html_node/Overriding.html |