Add an example of using a variable in a recipe parameter (#1311)
This commit is contained in:
parent
aed7ca1678
commit
35fb61af89
12
README.md
12
README.md
@ -1441,6 +1441,18 @@ build target:
|
|||||||
cd {{target}} && make
|
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:
|
A command's arguments can be passed to dependency by putting the dependency in parentheses along with the arguments:
|
||||||
|
|
||||||
```make
|
```make
|
||||||
|
Loading…
Reference in New Issue
Block a user