cflags cleanup

This commit is contained in:
Seeky 2022-07-06 12:51:40 +01:00
parent 794e50a8f8
commit 103c7d0057
3 changed files with 23 additions and 14 deletions

View File

@ -183,9 +183,7 @@ ASFLAGS = ' '.join([
])
CFLAGS = [
"-nostdinc",
"-enc SJIS",
"-proc gekko",
"-lang c99",
"-W all",
"-fp fmadd",
@ -194,21 +192,34 @@ CFLAGS = [
"-use_lmw_stmw on",
"-str pool",
"-rostr",
"-maxerrors 1",
"-sym on",
"-ipa file"
]
DOL_CFLAGS = ' '.join(CFLAGS + [
BASE_DOL_CFLAGS = CFLAGS + [
"-inline all",
"-sdata 4",
"-sdata2 4"
])
REL_CFLAGS = ' '.join(CFLAGS + [
]
BASE_REL_CFLAGS = CFLAGS + [
"-sdata 0",
"-sdata2 0",
"-pool off",
"-ordered-fp-compares"
])
]
LOCAL_CFLAGS = [
"-nostdinc",
"-proc gekko",
"-maxerrors 1",
"-I-",
f"-i {INCDIR}",
f"-i {PPCDIS_INCDIR}",
f"-i {BUILD_INCDIR}"
]
DOL_CFLAGS = ' '.join(BASE_DOL_CFLAGS + LOCAL_CFLAGS)
REL_CFLAGS = ' '.join(BASE_REL_CFLAGS + LOCAL_CFLAGS)
EXTERNAL_DOL_CFLAGS = ' '.join(BASE_DOL_CFLAGS)
EXTERNAL_REL_CFLAGS = ' '.join(BASE_REL_CFLAGS)
LDFLAGS = ' '.join([
"-fp hard",

View File

@ -165,7 +165,7 @@ n.rule(
# Due to CW dumbness with .d output location, $outstem must be defined without the .o
n.rule(
"cc",
command = f"$cc $cflags -I- -i {c.INCDIR} -i {c.PPCDIS_INCDIR} -i {c.BUILD_INCDIR} -MD -gccdep -c $in -o $out",
command = f"$cc $cflags -MD -gccdep -c $in -o $out",
description = "CC $in",
deps = "gcc",
depfile = "$outstem.d"
@ -173,7 +173,7 @@ n.rule(
n.rule(
"ccs",
command = f"$cc $cflags -I- -i {c.INCDIR} -i {c.BUILD_INCDIR} -MD -gccdep -c $in -o $out -S",
command = f"$cc $cflags -MD -gccdep -c $in -o $out -S",
description = "CC -S $in",
deps = "gcc",
depfile = "$outstem.d"

View File

@ -19,15 +19,13 @@ args = parser.parse_args()
# Find containing binary
binary, source = c.get_containing_slice(args.addr)
base_flags = "-lang c99 -enc SJIS -fp hard -O4 -use_lmw_stmw on -str pool -rostr -ipa file -cpp_exceptions off -sym on -W all"
# Get flags for binary (keep in sync with decomp.me templates)
# Get flags for binary
if binary == c.Binary.DOL:
preset = "Super Paper Mario (DOL)"
flags = base_flags + " -inline all -sdata 4 -sdata2 4"
flags = c.EXTERNAL_DOL_CFLAGS
else:
preset = "Super Paper Mario (REL)"
flags = base_flags + " -sdata 0 -sdata2 0 -pool off -ordered-fp-compares"
flags = c.EXTERNAL_REL_CFLAGS
# Disassemble function
srcflag = f"-n {source}" if isinstance(source, str) else ""