From 86edbf4ff2d3bcf88a189f8729eb1d751e2ccfb2 Mon Sep 17 00:00:00 2001 From: Florian Zaruba Date: Sun, 28 Aug 2022 22:28:16 +0200 Subject: Make path to encoding.h relative to script (#141) That allows for running the script out-of-tree. Signed-off-by: Florian Zaruba Signed-off-by: Florian Zaruba --- parse.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parse.py') diff --git a/parse.py b/parse.py index 90f1b41..940d814 100755 --- a/parse.py +++ b/parse.py @@ -846,7 +846,7 @@ def make_c(instr_dict): mask = ((1 << (end - begin + 1)) - 1) << begin arg_str += f"#define INSN_FIELD_{name.upper().replace(' ', '_')} {hex(mask)}\n" - with open('encoding.h', 'r') as file: + with open(f'{os.path.dirname(__file__)}/encoding.h', 'r') as file: enc_header = file.read() commit = os.popen('git log -1 --format="format:%h"').read() -- cgit v1.1