From cf8e20c366fbefef5aa374c194885845c6402040 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Tue, 20 Jun 2023 11:11:15 +0200
Subject: [PATCH] [machdep] new option in make_machdep.py for finding the
 schema

---
 share/machdeps/make_machdep/make_machdep.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/share/machdeps/make_machdep/make_machdep.py b/share/machdeps/make_machdep/make_machdep.py
index bd0b6cefa82..b3c5fa1cab2 100755
--- a/share/machdeps/make_machdep/make_machdep.py
+++ b/share/machdeps/make_machdep/make_machdep.py
@@ -61,6 +61,12 @@ parser.add_argument(
     help="option to pass to the compiler to obtain its version; default is --version",
 )
 
+parser.add_argument(
+    "--machdep-schema",
+    default="machdep-schema.yaml",
+    help="location of the schema file describing a machdep; default is 'machdep-schema.yaml'",
+)
+
 parser.add_argument(
     "--from-file",
     help="reads compiler and arch flags from existing yaml file. Use -i to update it in place",
@@ -106,8 +112,7 @@ if not args.cpp_arch_flags:
 
 
 def make_schema():
-    schema_filename = my_path.parent / "machdep-schema.yaml"
-    with open(schema_filename, "r") as schema:
+    with open(args.machdep_schema, "r") as schema:
         return yaml.safe_load(schema)
 
 
-- 
GitLab