diff --git a/make_machdep/.gitignore b/share/machdeps/make_machdep/.gitignore similarity index 100% rename from make_machdep/.gitignore rename to share/machdeps/make_machdep/.gitignore diff --git a/make_machdep/alignof_aligned.c b/share/machdeps/make_machdep/alignof_aligned.c similarity index 100% rename from make_machdep/alignof_aligned.c rename to share/machdeps/make_machdep/alignof_aligned.c diff --git a/make_machdep/alignof_double.c b/share/machdeps/make_machdep/alignof_double.c similarity index 100% rename from make_machdep/alignof_double.c rename to share/machdeps/make_machdep/alignof_double.c diff --git a/make_machdep/alignof_float.c b/share/machdeps/make_machdep/alignof_float.c similarity index 100% rename from make_machdep/alignof_float.c rename to share/machdeps/make_machdep/alignof_float.c diff --git a/make_machdep/alignof_fun.c b/share/machdeps/make_machdep/alignof_fun.c similarity index 100% rename from make_machdep/alignof_fun.c rename to share/machdeps/make_machdep/alignof_fun.c diff --git a/make_machdep/alignof_int.c b/share/machdeps/make_machdep/alignof_int.c similarity index 100% rename from make_machdep/alignof_int.c rename to share/machdeps/make_machdep/alignof_int.c diff --git a/make_machdep/alignof_long.c b/share/machdeps/make_machdep/alignof_long.c similarity index 100% rename from make_machdep/alignof_long.c rename to share/machdeps/make_machdep/alignof_long.c diff --git a/make_machdep/alignof_longdouble.c b/share/machdeps/make_machdep/alignof_longdouble.c similarity index 100% rename from make_machdep/alignof_longdouble.c rename to share/machdeps/make_machdep/alignof_longdouble.c diff --git a/make_machdep/alignof_longlong.c b/share/machdeps/make_machdep/alignof_longlong.c similarity index 100% rename from make_machdep/alignof_longlong.c rename to share/machdeps/make_machdep/alignof_longlong.c diff --git a/make_machdep/alignof_ptr.c b/share/machdeps/make_machdep/alignof_ptr.c similarity index 100% rename from make_machdep/alignof_ptr.c rename to share/machdeps/make_machdep/alignof_ptr.c diff --git a/make_machdep/alignof_short.c b/share/machdeps/make_machdep/alignof_short.c similarity index 100% rename from make_machdep/alignof_short.c rename to share/machdeps/make_machdep/alignof_short.c diff --git a/make_machdep/alignof_str.c b/share/machdeps/make_machdep/alignof_str.c similarity index 100% rename from make_machdep/alignof_str.c rename to share/machdeps/make_machdep/alignof_str.c diff --git a/make_machdep/char_is_unsigned.c b/share/machdeps/make_machdep/char_is_unsigned.c similarity index 100% rename from make_machdep/char_is_unsigned.c rename to share/machdeps/make_machdep/char_is_unsigned.c diff --git a/make_machdep/const_string_literals.c b/share/machdeps/make_machdep/const_string_literals.c similarity index 100% rename from make_machdep/const_string_literals.c rename to share/machdeps/make_machdep/const_string_literals.c diff --git a/make_machdep/has__builtin_va_list.c b/share/machdeps/make_machdep/has__builtin_va_list.c similarity index 100% rename from make_machdep/has__builtin_va_list.c rename to share/machdeps/make_machdep/has__builtin_va_list.c diff --git a/make_machdep/little_endian.c b/share/machdeps/make_machdep/little_endian.c similarity index 100% rename from make_machdep/little_endian.c rename to share/machdeps/make_machdep/little_endian.c diff --git a/make_machdep/make_machdep.py b/share/machdeps/make_machdep/make_machdep.py similarity index 96% rename from make_machdep/make_machdep.py rename to share/machdeps/make_machdep/make_machdep.py index 940d37ffa00e8d6e5e31626e797dd8d16c0f94de..1babce384c0205ae0f2fb5cd970bf4574741a42c 100755 --- a/make_machdep/make_machdep.py +++ b/share/machdeps/make_machdep/make_machdep.py @@ -88,20 +88,18 @@ args, other_args = parser.parse_known_args() def print_machdep(machdep): json.dump(machdep, args.dest_file, indent=4, sort_keys=True) - -fc_share = subprocess.run(["frama-c-config", "-print-share-path"], capture_output=True).stdout - - def check_machdep(machdep): try: from jsonschema import validate, ValidationError - with open(fc_share + "/machdeps/machdep-schema.json", "r") as schema: + schema_filename = my_path.parent / "machdep-schema.json" + + with open(schema_filename, "r") as schema: validate(machdep, json.load(schema)) except ImportError: warnings.warn("jsonschema is not available: no validation will be performed") except OSError: - warnings.warn("error opening machdep-schema.json: no validation will be performed") + warnings.warn(f"error opening {schema_filename}: no validation will be performed") except ValidationError: warnings.warn("machdep object is not conforming to machdep schema") @@ -243,4 +241,7 @@ if missing_fields: print("WARNING: the following fields are missing from the machdep definition:") print(", ".join(missing_fields)) +if args.check: + check_machdep(machdep) + print_machdep(machdep) diff --git a/make_machdep/make_machdep_common.h b/share/machdeps/make_machdep/make_machdep_common.h similarity index 100% rename from make_machdep/make_machdep_common.h rename to share/machdeps/make_machdep/make_machdep_common.h diff --git a/make_machdep/ptrdiff_t.c b/share/machdeps/make_machdep/ptrdiff_t.c similarity index 100% rename from make_machdep/ptrdiff_t.c rename to share/machdeps/make_machdep/ptrdiff_t.c diff --git a/make_machdep/size_t.c b/share/machdeps/make_machdep/size_t.c similarity index 100% rename from make_machdep/size_t.c rename to share/machdeps/make_machdep/size_t.c diff --git a/make_machdep/sizeof_double.c b/share/machdeps/make_machdep/sizeof_double.c similarity index 100% rename from make_machdep/sizeof_double.c rename to share/machdeps/make_machdep/sizeof_double.c diff --git a/make_machdep/sizeof_float.c b/share/machdeps/make_machdep/sizeof_float.c similarity index 100% rename from make_machdep/sizeof_float.c rename to share/machdeps/make_machdep/sizeof_float.c diff --git a/make_machdep/sizeof_fun.c b/share/machdeps/make_machdep/sizeof_fun.c similarity index 100% rename from make_machdep/sizeof_fun.c rename to share/machdeps/make_machdep/sizeof_fun.c diff --git a/make_machdep/sizeof_int.c b/share/machdeps/make_machdep/sizeof_int.c similarity index 100% rename from make_machdep/sizeof_int.c rename to share/machdeps/make_machdep/sizeof_int.c diff --git a/make_machdep/sizeof_long.c b/share/machdeps/make_machdep/sizeof_long.c similarity index 100% rename from make_machdep/sizeof_long.c rename to share/machdeps/make_machdep/sizeof_long.c diff --git a/make_machdep/sizeof_longdouble.c b/share/machdeps/make_machdep/sizeof_longdouble.c similarity index 100% rename from make_machdep/sizeof_longdouble.c rename to share/machdeps/make_machdep/sizeof_longdouble.c diff --git a/make_machdep/sizeof_longlong.c b/share/machdeps/make_machdep/sizeof_longlong.c similarity index 100% rename from make_machdep/sizeof_longlong.c rename to share/machdeps/make_machdep/sizeof_longlong.c diff --git a/make_machdep/sizeof_ptr.c b/share/machdeps/make_machdep/sizeof_ptr.c similarity index 100% rename from make_machdep/sizeof_ptr.c rename to share/machdeps/make_machdep/sizeof_ptr.c diff --git a/make_machdep/sizeof_short.c b/share/machdeps/make_machdep/sizeof_short.c similarity index 100% rename from make_machdep/sizeof_short.c rename to share/machdeps/make_machdep/sizeof_short.c diff --git a/make_machdep/sizeof_void.c b/share/machdeps/make_machdep/sizeof_void.c similarity index 100% rename from make_machdep/sizeof_void.c rename to share/machdeps/make_machdep/sizeof_void.c diff --git a/make_machdep/wchar_t.c b/share/machdeps/make_machdep/wchar_t.c similarity index 100% rename from make_machdep/wchar_t.c rename to share/machdeps/make_machdep/wchar_t.c