summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRozelette <Rozelette@users.noreply.github.com>2021-03-27 12:44:31 -0500
committerGitHub <noreply@github.com>2021-03-27 12:44:31 -0500
commit807db1ca549de3d38c42e24eb53f0803023ffcea (patch)
tree3f09e8c9133a3c513b1f036ae5a345cf697188e4
parentd0af9587bae947909890c63a9f72f5bc5c107253 (diff)
Improve the robustness of depend.py (#76)
-rwxr-xr-xtools/depend.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/depend.py b/tools/depend.py
index 5349c8a25..76aa779de 100755
--- a/tools/depend.py
+++ b/tools/depend.py
@@ -14,10 +14,11 @@ if __name__ == '__main__':
# Search for the first GLOBAL_ASM and use that as a dependency
# We won't list all split assembly files as it is tricky to properly set up make recipes with multiple outputs
for line in lines:
- if line.startswith('#pragma GLOBAL_ASM('):
- lines = line.replace('//', '/').split('/')
- asm_file = '/'.join(lines[1:-1]).replace('non_matchings/', '') + '.asm ' # base .asm file
- asm_file += '/'.join(lines[1:-1]) # split function .asm file
+ if '#pragma GLOBAL_ASM(' in line:
+ base_path = os.path.normpath(line.split('"')[1])
+ path = os.path.split(base_path)[0]
+ asm_file = path.replace('non_matchings/', '') + '.asm ' # base .asm file
+ asm_file += path # split function .asm file
break
with open(args.output, 'w') as f: