Ken Van Hoeylandt 85b61e1e43
Improve module configuration (#661)
DTS modules (device modules) often have a single source file with an empty `struct Module`.
The module's yaml file now allows a `dts-only` boolean to be set, so the source file becomes optional.
`devicetree.yaml` is renamed everywhere to `module.yaml`
2026-09-25 21:56:37 +02:00

30 lines
955 B
Python

import sys
from source.printing import print_error
from source.main import main
def print_help():
print("Usage: python compile.py [in_file] [out_path] [arguments]\n")
print(f"\t[in_path] the path where the root module.yaml file is")
print(f"\t[out_path] output folder for C file output")
print("")
print("Optional arguments:\n")
print("\t--help prints this help text")
print("\t--verbose output debug info")
if __name__ == "__main__":
if "--help" in sys.argv:
print_help()
sys.exit()
args = [a for a in sys.argv[1:] if not a.startswith("--")]
if len(args) < 2:
print_error("Missing argument")
print_help()
sys.exit()
is_verbose = "--verbose" in sys.argv
devicetree_yaml_config = args[0]
output_path = args[1]
result = main(devicetree_yaml_config, output_path, is_verbose)
sys.exit(result)