Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: one line rules #9

Open
vicencb opened this issue Oct 1, 2023 · 2 comments
Open

Feature request: one line rules #9

vicencb opened this issue Oct 1, 2023 · 2 comments

Comments

@vicencb
Copy link

vicencb commented Oct 1, 2023

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

targets : attributes : prerequisites ; recipe

@zyedidia
Copy link
Owner

zyedidia commented Oct 1, 2023

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

targets:attributes: prereqs > recipe

@vicencb
Copy link
Author

vicencb commented Oct 2, 2023

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 ">"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants