Update CHEATSHEET.md
This commit is contained in:
parent
99a07d23a4
commit
158da0c5e9
@ -36,9 +36,9 @@ are syntax that add quotation marks around `key`, so you call them without the q
|
|||||||
Assign `val` to `key` in the `%makevars` hash table. If `val` is a procedure,
|
Assign `val` to `key` in the `%makevars` hash table. If `val` is a procedure,
|
||||||
evaluate it and assign its output to `key` immediately.
|
evaluate it and assign its output to `key` immediately.
|
||||||
|
|
||||||
## RULES
|
## Rules
|
||||||
|
|
||||||
The target rule is for when the target, and the prerequisites, if any,
|
The *target rule* is for when the target, and the prerequisites, if any,
|
||||||
have filenames or phony names.
|
have filenames or phony names.
|
||||||
|
|
||||||
(: target-name '(prereq-name-1 prereq-name-2 ...)
|
(: target-name '(prereq-name-1 prereq-name-2 ...)
|
||||||
@ -80,13 +80,13 @@ have filenames or phony names.
|
|||||||
(: "foo.c" '("foo.c")
|
(: "foo.c" '("foo.c")
|
||||||
(~ ($ CC) ($ CFLAGS) "-c" $<))
|
(~ ($ CC) ($ CFLAGS) "-c" $<))
|
||||||
|
|
||||||
The suffix rule is a generic rule to convert one file type to another.
|
The *suffix rule* is a generic rule to convert one source file to
|
||||||
Note that the prerequisites is *not* a list.
|
a target file, based on the filename extensions.
|
||||||
|
|
||||||
(-> ".c" ".o"
|
(-> ".c" ".o"
|
||||||
(~ ($ CC) ($ CFLAGS) ".c" $<))
|
(~ ($ CC) ($ CFLAGS) "-c" $< "-o" $@))
|
||||||
|
|
||||||
# RECIPE HELPERS
|
## Recipe Helpers
|
||||||
|
|
||||||
Concatenate elements with `~`. `~` inserts spaces between the elements.
|
Concatenate elements with `~`. `~` inserts spaces between the elements.
|
||||||
Elements can be
|
Elements can be
|
||||||
@ -104,6 +104,8 @@ Note that the prerequisites is *not* a list.
|
|||||||
(~@ ...) doesn't print recipe to console
|
(~@ ...) doesn't print recipe to console
|
||||||
(~+ ...) runs even when `--no-execute` was chosen
|
(~+ ...) runs even when `--no-execute` was chosen
|
||||||
|
|
||||||
|
## Special Variables
|
||||||
|
|
||||||
Recipes can contain the following special variables
|
Recipes can contain the following special variables
|
||||||
|
|
||||||
$@ the target
|
$@ the target
|
||||||
|
Loading…
Reference in New Issue
Block a user