aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2023-05-17 17:13:51 +0200
committerJohannes Stoelp <johannes.stoelp@gmail.com>2023-05-17 17:13:51 +0200
commite526873c5277ad28f7efb24d949240f07a95dd43 (patch)
tree6a173606e68d2094614a04a96f141d6f807e6f01
parenta3c6de1d257ce0b58d4c0386d8044f0673b68c91 (diff)
downloadnotes-e526873c5277ad28f7efb24d949240f07a95dd43.tar.gz
notes-e526873c5277ad28f7efb24d949240f07a95dd43.zip
make: add comment about cmdline args
-rw-r--r--src/development/make.md23
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