diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/development/make.md | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/development/make.md b/src/development/make.md index 1ebe98e..254a7d7 100644 --- a/src/development/make.md +++ b/src/development/make.md @@ -101,6 +101,15 @@ out := $(in:.o=.c) # => out = a.c l.a c.c ``` +### `patsubst` ([ref][make-patsubst]) +```make +in := a.c b.c +out := $(patsubst %.c, build/%.o, $(in)) +# => out = build/a.o build/b.o + +# This is actually equivalent to $(in:%.c=build/%.o) +``` + ### `filter` Keep strings matching a pattern in a list. ```make @@ -129,3 +138,4 @@ $(realpath fname1 fname2 ..) ``` [make-var-override]: https://www.gnu.org/software/make/manual/html_node/Overriding.html +[make-patsubst]: https://www.gnu.org/software/make/manual/html_node/Text-Functions.html#index-patsubst-1 |