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

add: support for Makefile (simplified) #68

Closed
14 tasks done
metaist opened this issue Aug 21, 2024 · 5 comments
Closed
14 tasks done

add: support for Makefile (simplified) #68

metaist opened this issue Aug 21, 2024 · 5 comments

Comments

@metaist
Copy link
Owner

metaist commented Aug 21, 2024

Thanks to @jhostyk for pushing me to support a simplified Makefile format.

Current example: https://github.com/metaist/ds/blob/main/examples/formats/Makefile

  • treat all targets as .PHONY:
  • handle 1 target name (hold off on multiple targets or repeating the target multiple times)
  • multiple prerequisites
  • first line of recipe on the same line
  • handle line continuations outside of recipe
  • handle line continuations inside the recipe (hold off on .POSIX: for now)
  • treat the recipe as one big lump you send to the shell
  • (NONSTANDARD) handle error suppression (-) in any line of the recipe
  • (NONSTANDARD) handle error suppression (-) in any prerequisite name
  • (NONSTANDARD) read comment on target definition line as description
  • $@ name of the target
  • $< first prerequisite (not supported: archive)
  • $? all prerequisites (not supported: "newer than target")
  • $^ all prerequisites only once
@metaist
Copy link
Owner Author

metaist commented Aug 22, 2024

The idea of grabbing the comment on the same line as the targets is clever, but maybe too clever. .json files don't get a comment, so Makefile probably shouldn't either.

@metaist
Copy link
Owner Author

metaist commented Aug 22, 2024

The example they have documents it as such: https://www.gnu.org/software/make/manual/make.html#Rule-Example

Going to put it back in.

@metaist
Copy link
Owner Author

metaist commented Aug 22, 2024

@metaist metaist reopened this Aug 22, 2024
@metaist
Copy link
Owner Author

metaist commented Aug 22, 2024

If I ever want to implement more, Chris Wellons has some reasonable suggestions:
https://nullprogram.com/blog/2017/08/20/

@metaist
Copy link
Owner Author

metaist commented Aug 28, 2024

After #77, we can actually use _.env as a place to store common env which we want to add to all recipes.

This issue was closed.
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

1 participant