From 68fe856234ee80d016a0a264506885354777bce0 Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Thu, 4 Feb 2021 13:54:08 +0000 Subject: [PATCH] permuter --- .gitignore | 2 ++ configure.py | 13 ++++++++++--- tools/permuter_settings.toml | 3 --- 3 files changed, 12 insertions(+), 6 deletions(-) delete mode 100644 tools/permuter_settings.toml diff --git a/.gitignore b/.gitignore index 54e0d3226d..5e13ec6d3b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ build.ninja /include/message_ids.h /include/sprite/ /include/map +/tools/permuter_settings.toml # Assets /bin @@ -33,6 +34,7 @@ build.ninja # Star Rod /sprite/SpriteTable.xml /mod.cfg +/tools/star-rod /tools/Yay0compress /tools/n64crc diff --git a/configure.py b/configure.py index de574f1348..21f6f860ee 100755 --- a/configure.py +++ b/configure.py @@ -183,10 +183,13 @@ async def main(): n = ninja_syntax.Writer(open("build.ninja", "w"), width=120) cppflags = "-Iinclude -Isrc -D _LANGUAGE_C -D _FINALROM -ffreestanding -DF3DEX_GBI_2 -D_MIPS_SZLONG=32 " + args.cflags + cflags = "-O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow " + args.cflags + iconv = "tools/iconv.py UTF-8 SHIFT-JIS" if sys.platform == "darwin" else "iconv --from UTF-8 --to SHIFT-JIS" + cross = "mips-linux-gnu-" n.variable("builddir", "build") n.variable("target", TARGET) - n.variable("cross", "mips-linux-gnu-") + n.variable("cross", cross) n.variable("python", sys.executable) if sys.platform == "darwin": @@ -201,9 +204,9 @@ async def main(): sys.exit(1) n.variable("os", os_dir) - n.variable("iconv", "tools/iconv.py UTF-8 SHIFT-JIS" if sys.platform == "darwin" else "iconv --from UTF-8 --to SHIFT-JIS") + n.variable("iconv", iconv) n.variable("cppflags", f"{cppflags} -Wcomment") - n.variable("cflags", "-O2 -quiet -G 0 -mcpu=vr4300 -mfix4300 -mips3 -mgp32 -mfp32 -Wuninitialized -Wshadow " + args.cflags) + n.variable("cflags", cflags) n.newline() n.rule("cc", @@ -218,6 +221,10 @@ async def main(): deps="gcc") n.newline() + with open("tools/permuter_settings.toml", "w") as f: + f.write(f"compiler_command = \"{cpp} {cppflags} -D SCRIPT(...)={{}} | {iconv} | tools/{os_dir}/cc1 {cflags} -o - | tools/{os_dir}/mips-nintendo-nu64-as -EB -G 0 -\"\n") + f.write(f"assembler_command = \"{cross}as -march=vr4300 -mabi=32\"\n") + n.rule("cpp", command=f"{cpp} -P -DBUILD_DIR=$builddir $in -o $out", description="cc (with dsl) $in", diff --git a/tools/permuter_settings.toml b/tools/permuter_settings.toml deleted file mode 100644 index 5c636342a2..0000000000 --- a/tools/permuter_settings.toml +++ /dev/null @@ -1,3 +0,0 @@ -build_system = "ninja" -[preserve_macros] -SCRIPT = "void"