lrparsers/makedep.py
John Doty 6692d12d36 [parser] Makefile nonsense
Includes are now explicit so they can be extracted into dependencies
for the makefile.
2024-10-26 12:29:27 -07:00

16 lines
472 B
Python

import tomllib
def main():
with open("pyproject.toml", "rb") as f:
result = tomllib.load(f)
version = result["project"]["version"]
includes = result["tool"]["pdm"]["build"]["includes"]
with open("lrparser.mk", "w", encoding="utf-8") as f:
f.write("# This file generated by makedep.py\n")
f.write(f"VERSION={version}\n")
f.write(f"PYTHON_SOURCES=\\\n\t{' \\\n\t'.join(includes)}\n")
if __name__ == "__main__":
main()