Some more work on string expansion.
This commit is contained in:
parent
084a45fc74
commit
f812efe3ad
4 changed files with 90 additions and 35 deletions
34
README.md
34
README.md
|
|
@ -11,42 +11,44 @@ of it. Put simply, mk takes make, keeps its simple direct syntax, but fixes
|
|||
basically everything that's annoyed you over the years. To name a few things:
|
||||
|
||||
1. Recipes are delimited by any indentation, not tab characters in particular.
|
||||
2. Phony targets are handled separately from file targets. Your mkfile won't
|
||||
1. Phony targets are handled separately from file targets. Your mkfile won't
|
||||
be broken by having a file named 'clean'.
|
||||
2. Attributes instead of weird special targets like `.SECONDARY:`.
|
||||
5. Special variables like `$target`, `$prereq`, and `$stem` in place of
|
||||
1. Attributes instead of weird special targets like `.SECONDARY:`.
|
||||
1. Special variables like `$target`, `$prereq`, and `$stem` in place of
|
||||
make's pointlessly cryptic `$@`, `$^`, and `$*`.
|
||||
3. In addition to suffix rules (e.g. `%.o: %.c`), mk has more powerful regular
|
||||
1. In addition to suffix rules (e.g. `%.o: %.c`), mk has more powerful regular
|
||||
expression rules.
|
||||
4. Sane handling of rules with multiple targets.
|
||||
5. An optional attribute to delete targets when a recipe fails, so you aren't
|
||||
1. Sane handling of rules with multiple targets.
|
||||
1. An optional attribute to delete targets when a recipe fails, so you aren't
|
||||
left with corrupt output.
|
||||
6. Plan 9 mkfiles can not only include other mkfiles, but pipe in the output of
|
||||
1. Plan 9 mkfiles can not only include other mkfiles, but pipe in the output of
|
||||
recipes. Your mkfile can configure itself by doing something like
|
||||
`<|sh config.sh`.
|
||||
7. A generalized mechanism to determine if a target is out of date, for when
|
||||
1. A generalized mechanism to determine if a target is out of date, for when
|
||||
timestamps won't cut it.
|
||||
1. Variables are expanded in recipes only if they are defined. They way you
|
||||
usually don't have to escape `$`.
|
||||
|
||||
And much more! For more, read the original mk paper: ["Mk: a successor to
|
||||
make"](#).
|
||||
|
||||
# Improvements over Plan 9 mk
|
||||
|
||||
This mk stays mostly faithful to Plan 9, but makes a few minor (in my opinion)
|
||||
This mk stays mostly faithful to Plan 9, but makes a few (in my opinion)
|
||||
improvements.
|
||||
|
||||
1. A clean, modern implementation in go, that doesn't depend on the whole plan
|
||||
9 for userspace stack.
|
||||
1. Use go regular expressions, which are perl-like. The original mk used plan9
|
||||
regex, which few people know or care to learn.
|
||||
1. Allow blank lines in recipes. A recipe is any indented block of text, and
|
||||
continues until a non-indented character or the end of the file.
|
||||
2. Add an 'S' attribute to execute recipes with programs other than sh. This
|
||||
1. Add an 'S' attribute to execute recipes with programs other than sh. This
|
||||
way, you don't have to separate your six line python script into its own
|
||||
file. Just stick it in the mkfile.
|
||||
3. Use a perl-compatible regular expressions. The original mk used plan9
|
||||
regex, which few people know or care to learn.
|
||||
4. A clean, modern implementation in go, that doesn't depend on the whole plan
|
||||
9 for userspace stack.
|
||||
1. Use sh syntax for command insertion (i.e. backticks) rather than rc shell
|
||||
syntax.
|
||||
|
||||
Most Plan 9 mkfiles should remain backwards compatible, but strict backwards
|
||||
compatibility isn't the goal.
|
||||
|
||||
# Current State
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue