From 35fb61af893c7185b07d7a274b3569993eb3e74b Mon Sep 17 00:00:00 2001 From: Michael Zeller Date: Tue, 16 Aug 2022 14:25:10 -0400 Subject: [PATCH] Add an example of using a variable in a recipe parameter (#1311) --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 998bdb9..8eb95f4 100644 --- a/README.md +++ b/README.md @@ -1441,6 +1441,18 @@ build target: cd {{target}} && make ``` +Variables can also be passed as arguments to dependencies: + +```make +target := "main" + +_build version: + @echo 'Building {{version}}…' + cd {{version}} && make + +build: (_build target) +``` + A command's arguments can be passed to dependency by putting the dependency in parentheses along with the arguments: ```make