knit icon indicating copy to clipboard operation
knit copied to clipboard

Feature request: one line rules

Open vicencb opened this issue 2 years ago • 2 comments

Makefiles also support this: https://www.gnu.org/software/make/manual/html_node/Rule-Syntax.html

targets : attributes : prerequisites ; recipe

vicencb avatar Oct 01 '23 17:10 vicencb

Ah I didn't know the Make syntax, but Knit supports this with the following syntax:

targets:attributes: prereqs > recipe

zyedidia avatar Oct 01 '23 21:10 zyedidia

Indeed, just tested it and works, mostly.

i don't see that syntax documented, so, it is not expected that it is widely used. Then, why not change it and make it like makefiles?

Also, it does not work together with the D attribute: $ $(builddir)/%.o : D[$(builddir)/%.d] : %.c > $(CC) $(CFLAGS) -MMD -c $(input) -o $(output) syntax error: while reading a rule's prerequisites, expected filename or pattern but found ">"

vicencb avatar Oct 02 '23 23:10 vicencb