diff options
| author | Aetias <144526980+AetiasHax@users.noreply.github.com> | 2024-06-21 11:53:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-21 11:53:12 +0200 |
| commit | 925505ed5dc1deb4bd9c3de281233b65dca55016 (patch) | |
| tree | be7fe35bad91bb957553d036346ea563311fc5b3 /tools/objdiff.py | |
| parent | 536e7af2cbd9edd54abde545c1e86e6ff304fc8b (diff) | |
| parent | 5f4d3da8679729d138344af3628e15df6030386b (diff) | |
Merge pull request #50 from AetiasHax/objdiff-integration
`objdiff` integration
Diffstat (limited to 'tools/objdiff.py')
| -rw-r--r-- | tools/objdiff.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/objdiff.py b/tools/objdiff.py index 1e6ec65d..16078798 100644 --- a/tools/objdiff.py +++ b/tools/objdiff.py @@ -35,14 +35,15 @@ def find_asm_path(src_path: Path) -> Path | None: return asm_path -def get_build_path(path: Path) -> Path: +def get_build_path(path: Path, extension='.o') -> Path: region = args.region.lower() - return Path('build') / region / path.parent / (path.name + '.o') + return Path('build') / region / path.parent / (path.name + extension) config = dict() config["custom_make"] = "make" config["custom_args"] = [ + "-B", f"REGION={args.region}" ] config["build_target"] = True @@ -61,6 +62,7 @@ for (root, dirs, files) in os.walk(src_dir): src_path = Path(f'{root}/{file}') src_path = src_path.relative_to(src_dir) asm_path = find_asm_path(src_path) + src_path = 'src' / src_path if asm_path: asm_path = 'asm' / asm_path @@ -69,9 +71,17 @@ for (root, dirs, files) in os.walk(src_dir): obj = dict() obj["name"] = name if asm_path.exists(): obj["target_path"] = str(get_build_path(asm_path)) - obj["base_path"] = str(get_build_path('src' / src_path)) + obj["base_path"] = str(get_build_path(src_path)) obj["reverse_fn_order"] = False + scratch = dict() + scratch["platform"] = "nds_arm9" + scratch["compiler"] = "mwcc_30_131" + scratch["ctx_path"] = str(get_build_path(src_path, '.ctx')) + scratch["build_ctx"] = True + + obj["scratch"] = scratch + config["objects"].append(obj) with open(config_path, 'w') as f: |
