mirror of https://github.com/PrimeDecomp/prime.git
Remove duplication in defining rules
This commit is contained in:
parent
f2fa19ab38
commit
9f6f0b596c
108
configure.py
108
configure.py
|
@ -1174,96 +1174,81 @@ if __name__ == "__main__":
|
||||||
# Rules
|
# Rules
|
||||||
###
|
###
|
||||||
if os.name == "nt":
|
if os.name == "nt":
|
||||||
n.comment("MWCC build")
|
mwcc_command = "tools\\mwcc_compiler\\$mwcc_version\\mwcceppc.exe $cflags -c $in -o $basedir"
|
||||||
n.rule(
|
mwcc_frank_command = (
|
||||||
name="mwcc",
|
ALLOW_CHAIN
|
||||||
command="tools\\mwcc_compiler\\$mwcc_version\\mwcceppc.exe $cflags -c $in -o $basedir",
|
|
||||||
description="MWCC $out",
|
|
||||||
depfile="$basefile.d",
|
|
||||||
deps="gcc",
|
|
||||||
)
|
|
||||||
n.newline()
|
|
||||||
n.comment("MWCC build with franklite")
|
|
||||||
n.rule(
|
|
||||||
name="mwcc_frank",
|
|
||||||
command=ALLOW_CHAIN
|
|
||||||
+ "tools\\mwcc_compiler\\$mwcc_version\\mwcceppc.exe $cflags -c $in -o $basedir && "
|
+ "tools\\mwcc_compiler\\$mwcc_version\\mwcceppc.exe $cflags -c $in -o $basedir && "
|
||||||
+ "$python tools/franklite.py $out $out",
|
+ "$python tools/franklite.py $out $out"
|
||||||
description="FRANK $out",
|
|
||||||
depfile="$basefile.d",
|
|
||||||
deps="gcc",
|
|
||||||
)
|
)
|
||||||
n.newline()
|
link_elf_command = "tools\\mwcc_compiler\\$mwcc_version\\mwldeppc.exe $ldflags -o $out @$out.rsp"
|
||||||
|
assemble_asm_command = (
|
||||||
|
ALLOW_CHAIN
|
||||||
|
+ "$devkitppc\\bin\\powerpc-eabi-as.exe $asflags -o $out $in -MD $out.d"
|
||||||
|
+ " && $dtk elf fixup $out $out"
|
||||||
|
)
|
||||||
|
|
||||||
n.comment("Link ELF file")
|
n.comment("Link ELF file")
|
||||||
n.rule(
|
n.rule(
|
||||||
name="link",
|
name="link",
|
||||||
command="tools\\mwcc_compiler\\$mwcc_version\\mwldeppc.exe $ldflags -o $out @$out.rsp",
|
command=link_elf_command,
|
||||||
description="LINK $out",
|
description="LINK $out",
|
||||||
rspfile="$out.rsp",
|
rspfile="$out.rsp",
|
||||||
rspfile_content="$in",
|
rspfile_content="$in",
|
||||||
)
|
)
|
||||||
n.newline()
|
n.newline()
|
||||||
n.comment("Assemble asm")
|
|
||||||
n.rule(
|
|
||||||
name="as",
|
|
||||||
command=ALLOW_CHAIN
|
|
||||||
+ "$devkitppc\\bin\\powerpc-eabi-as.exe $asflags -o $out $in -MD $out.d"
|
|
||||||
+ " && $dtk elf fixup $out $out",
|
|
||||||
description="AS $out",
|
|
||||||
depfile="$out.d",
|
|
||||||
deps="gcc",
|
|
||||||
)
|
|
||||||
n.newline()
|
|
||||||
n.comment("Create static library")
|
|
||||||
n.rule(
|
|
||||||
name="ar",
|
|
||||||
command="$dtk ar create $out @$out.rsp",
|
|
||||||
description="AR $out",
|
|
||||||
rspfile="$out.rsp",
|
|
||||||
rspfile_content="$in_newline",
|
|
||||||
)
|
|
||||||
n.newline()
|
|
||||||
else:
|
else:
|
||||||
n.comment("MWCC build")
|
mwcc_command = "${wine}tools/mwcc_compiler/$mwcc_version/mwcceppc.exe $cflags -c $in -o $basedir && $python tools/transform-dep.py $basefile.d $basefile.d"
|
||||||
n.rule(
|
mwcc_frank_command = (
|
||||||
name="mwcc",
|
"${wine}tools/mwcc_compiler/$mwcc_version/mwcceppc.exe $cflags -c $in -o $basedir && "
|
||||||
command="${wine}tools/mwcc_compiler/$mwcc_version/mwcceppc.exe $cflags -c $in -o $basedir && "
|
|
||||||
+ "$python tools/transform-dep.py $basefile.d $basefile.d",
|
|
||||||
description="MWCC $out",
|
|
||||||
depfile="$basefile.d",
|
|
||||||
deps="gcc",
|
|
||||||
)
|
|
||||||
n.newline()
|
|
||||||
n.comment("MWCC build with franklite")
|
|
||||||
n.rule(
|
|
||||||
name="mwcc_frank",
|
|
||||||
command="${wine}tools/mwcc_compiler/$mwcc_version/mwcceppc.exe $cflags -c $in -o $basedir && "
|
|
||||||
+ "$python tools/franklite.py $out $out && "
|
+ "$python tools/franklite.py $out $out && "
|
||||||
+ "$python tools/transform-dep.py $basefile.d $basefile.d",
|
+ "$python tools/transform-dep.py $basefile.d $basefile.d"
|
||||||
description="FRANK $out",
|
|
||||||
depfile="$basefile.d",
|
|
||||||
deps="gcc",
|
|
||||||
)
|
)
|
||||||
n.newline()
|
link_elf_command = "${wine}tools/mwcc_compiler/$mwcc_version/mwldeppc.exe $ldflags -o $out @$out.rsp"
|
||||||
|
assemble_asm_command = (
|
||||||
|
"$devkitppc/bin/powerpc-eabi-as $asflags -o $out $in -MD $out.d"
|
||||||
|
+ " && $dtk elf fixup $out $out"
|
||||||
|
)
|
||||||
|
|
||||||
n.comment("Link ELF file")
|
n.comment("Link ELF file")
|
||||||
n.rule(
|
n.rule(
|
||||||
name="link",
|
name="link",
|
||||||
command="${wine}tools/mwcc_compiler/$mwcc_version/mwldeppc.exe $ldflags -o $out @$out.rsp",
|
command=link_elf_command,
|
||||||
description="LINK $out",
|
description="LINK $out",
|
||||||
rspfile="$out.rsp",
|
rspfile="$out.rsp",
|
||||||
rspfile_content="$in_newline",
|
rspfile_content="$in_newline",
|
||||||
)
|
)
|
||||||
n.newline()
|
n.newline()
|
||||||
|
|
||||||
|
n.comment("MWCC build")
|
||||||
|
n.rule(
|
||||||
|
name="mwcc",
|
||||||
|
command=mwcc_command,
|
||||||
|
description="MWCC $out",
|
||||||
|
depfile="$basefile.d",
|
||||||
|
deps="gcc",
|
||||||
|
)
|
||||||
|
n.newline()
|
||||||
|
|
||||||
|
n.comment("MWCC build with franklite")
|
||||||
|
n.rule(
|
||||||
|
name="mwcc_frank",
|
||||||
|
command=mwcc_frank_command,
|
||||||
|
description="FRANK $out",
|
||||||
|
depfile="$basefile.d",
|
||||||
|
deps="gcc",
|
||||||
|
)
|
||||||
|
n.newline()
|
||||||
|
|
||||||
n.comment("Assemble asm")
|
n.comment("Assemble asm")
|
||||||
n.rule(
|
n.rule(
|
||||||
name="as",
|
name="as",
|
||||||
command="$devkitppc/bin/powerpc-eabi-as $asflags -o $out $in -MD $out.d"
|
command=assemble_asm_command,
|
||||||
+ " && $dtk elf fixup $out $out",
|
|
||||||
description="AS $out",
|
description="AS $out",
|
||||||
depfile="$out.d",
|
depfile="$out.d",
|
||||||
deps="gcc",
|
deps="gcc",
|
||||||
)
|
)
|
||||||
n.newline()
|
n.newline()
|
||||||
|
|
||||||
n.comment("Create static library")
|
n.comment("Create static library")
|
||||||
n.rule(
|
n.rule(
|
||||||
name="ar",
|
name="ar",
|
||||||
|
@ -1273,6 +1258,7 @@ if __name__ == "__main__":
|
||||||
rspfile_content="$in_newline",
|
rspfile_content="$in_newline",
|
||||||
)
|
)
|
||||||
n.newline()
|
n.newline()
|
||||||
|
|
||||||
n.comment("Host build")
|
n.comment("Host build")
|
||||||
n.variable("host_cflags", "-I include/ -Wno-trigraphs")
|
n.variable("host_cflags", "-I include/ -Wno-trigraphs")
|
||||||
n.variable(
|
n.variable(
|
||||||
|
|
Loading…
Reference in New Issue