m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Chrzanowski <m@m-chrzan.xyz>2023-12-04 03:22:53 +0100
committerMarcin Chrzanowski <m@m-chrzan.xyz>2023-12-04 03:22:53 +0100
commitec967225b749d016b47dc9e530acb340e544d362 (patch)
tree5a78389327c8a3262c28ca61af7396789ddc7ed7
parent7323b39c5e11a9ab6811cc5f637c94e95846bab9 (diff)
Modify and add make tips
-rw-r--r--makefile.md17
1 files changed, 15 insertions, 2 deletions
diff --git a/makefile.md b/makefile.md
index 0499a4d..50b5aae 100644
--- a/makefile.md
+++ b/makefile.md
@@ -14,10 +14,17 @@ Details: <https://www.gnu.org/software/make/manual/html_node/Pattern-Rules.html>
* `$@`: current target
* `$<`: first prerequisite
* `$^`: all prerequisites, separated by spaces
+* `$*`: target without extension
* `$(@F)`: file-within-directory part of target path
More: <https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html>
+## C-related flags
+
+* `CC`: C compiler
+* `CFLAGS`: flags for `CC`
+* `LDFLAGS`: flags for the linker
+
## Text functions
* `$(var:suffix=replacement)`, syntax sugar for
@@ -29,6 +36,12 @@ More: <https://www.gnu.org/software/make/manual/html_node/Text-Functions.html>
<https://www.gnu.org/software/make/manual/html_node/File-Name-Functions.html>
-## Quiet commands
+## Recipes
+
+* `@<command>`: don't print command ran
+* `-<command>`: don't exit on command failure
+
+## Arguments
+
+* `-B, --always-make`: force to make all targets
-By default, `make` prints the command being run. Prepend `@` to silence this.