From 1e1600cec707d62e2c854c7222b2ea8a4283658d Mon Sep 17 00:00:00 2001 From: Aetias Date: Sun, 9 Mar 2025 17:10:52 +0100 Subject: [PATCH] ninja: Phonies for `arm9` and `report` --- tools/configure.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/tools/configure.py b/tools/configure.py index a1996b85..056682e9 100755 --- a/tools/configure.py +++ b/tools/configure.py @@ -252,6 +252,18 @@ def main(): ) n.newline() + n.rule( + name="check_modules", + command=f"{DSD} check modules --config-path $config_path" + ) + n.newline() + + n.rule( + name="check_symbols", + command=f"{DSD} check symbols --config-path $config_path --elf-path $elf_path" + ) + n.newline() + n.rule( name="sha1", command=f"{PYTHON} tools/sha1.py $in -c $sha1_file" @@ -263,6 +275,7 @@ def main(): add_delink_and_lcf_builds(n, project) add_mwcc_builds(n, project, mwcc_implicit) add_mwld_and_rom_builds(n, project) + add_check_builds(n, project) add_objdiff_builds(n, project) @@ -345,6 +358,13 @@ def add_mwld_and_rom_builds(n: ninja_syntax.Writer, project: Project): ) n.newline() + n.build( + inputs=elf_file, + rule="phony", + outputs="arm9", + ) + n.newline() + rom_config_file = str(project.build_rom_config()) n.build( inputs=elf_file, @@ -469,6 +489,36 @@ def add_delink_and_lcf_builds(n: ninja_syntax.Writer, project: Project): n.newline() +def add_check_builds(n: ninja_syntax.Writer, project: Project): + n.build( + inputs=str(project.arm9_o()), + rule="check_modules", + outputs="check_modules", + variables={ + "config_path": project.arm9_config_yaml(), + }, + ) + n.newline() + + n.build( + inputs=str(project.arm9_o()), + rule="check_symbols", + outputs="check_symbols", + variables={ + "config_path": project.arm9_config_yaml(), + "elf_path": project.arm9_o(), + }, + ) + n.newline() + + n.build( + inputs=["check_modules", "check_symbols"], + rule="phony", + outputs="check", + ) + n.newline() + + def add_objdiff_builds(n: ninja_syntax.Writer, project: Project): n.build( inputs=project.dsd_configs(), @@ -496,6 +546,13 @@ def add_objdiff_builds(n: ninja_syntax.Writer, project: Project): ) n.newline() + n.build( + inputs=str(project.objdiff_report()), + rule="phony", + outputs="report", + ) + n.newline() + def get_config_files(game_config: Path, name: str) -> list[str]: return [