Update hard-coded build dir names

This commit is contained in:
J.Ingram 2025-05-03 22:22:13 -04:00
parent cfb18b62a4
commit de5a9a08a7
10 changed files with 1357 additions and 1357 deletions

View File

@ -17,8 +17,8 @@ BSS_START = 0x800ABBF0
BSS_SIZE = 0x17618
ASM = '../obj/data/bss.asm'
IN = '../src/data/bss.c'
OUT = '../src/data/bss.c'
IN = '../source/data/bss.c'
OUT = '../source/data/bss.c'
parser = argparse.ArgumentParser()
parser.add_argument('--psyq_path', type=str, default=os.environ.get('PSYQ_SDK') or '../../psyq_sdk',
@ -39,7 +39,7 @@ def cc1():
'-D__GNUC__=2',
'-D__OPTIMIZE__',
'-I', os.path.join(args.psyq_path, 'psyq_4.4/include'),
'-I', '../src',
'-I', '../source',
'-lang-c',
'-Dmips',
'-D__mips__', '-D__mips',

View File

@ -186,7 +186,7 @@ ninja.newline()
ninja.variable("psyq_psylink_overlay_fopen_mod_exe", prefix("wibo", "$psyq_path/psyq_4.4/bin/psylink_overlay_fopen_mod.exe"))
ninja.newline()
ninja.variable("src_dir", "../src")
ninja.variable("src_dir", "../source")
ninja.newline()
if args.variant == 'vr_exe':
@ -295,21 +295,21 @@ def get_files_recursive(path, ext):
return collectedFiles
def get_file_global_size(file):
if "overlays/" in file or "mts/" in file or "SD/" in file:
if "overlays/" in file or "mts/" in file or "sd/" in file:
return "0"
g0_list = [
"/Equip/",
"/Bullet/",
"/Thing/",
"/Okajima/",
"Game/item.c", # todo figure out if correct, why not all .c files in this dir ??
"/equip/",
"/bullet/",
"/thing/",
"/okajima/",
"game/item.c", # todo figure out if correct, why not all .c files in this dir ??
"anime.c", # ditto
"vibrate.c",
"/Takabe/",
"/takabe/",
"/libfs/",
"Kojo/demo.c",
"Kojo/demothrd.c",
"kojo/demo.c",
"kojo/demothrd.c",
"strctrl.c",
"jimctrl.c",
"memcard.c",
@ -328,7 +328,7 @@ def gen_build_target(targetName):
asmFiles = get_files_recursive("../asm", ".s")
print("Got " + str(len(asmFiles)) + " asm files")
cFiles = get_files_recursive("../src", ".c")
cFiles = get_files_recursive("../source", ".c")
print("Got " + str(len(cFiles)) + " source files")
linkerDeps = []
@ -348,7 +348,7 @@ def gen_build_target(targetName):
# build .c files
for cFile in cFiles:
cFile = cFile.replace("\\", "/")
cOFile = cFile.replace("/src/", f"/{args.obj_directory}/")
cOFile = cFile.replace("/source/", f"/{args.obj_directory}/")
cPreProcHeadersFile = cOFile.replace(".c", ".c.preproc.headers")
cPreProcHeadersFixedFile = cOFile.replace(".c", ".c.preproc.headers_fixed")
cConvertedFile = cOFile.replace(".c", ".c.eucjp")
@ -365,7 +365,7 @@ def gen_build_target(targetName):
ninja.build(cPreProcHeadersFixedFile, "header_deps", cPreProcHeadersFile)
compiler = "psyq_cc_44"
if "mts/" in cFile or "SD/" in cFile:
if "mts/" in cFile or "sd/" in cFile:
compiler = "psyq_cc_43"
aspsx = "psyq_aspsx_assemble_44"
@ -374,7 +374,7 @@ def gen_build_target(targetName):
aspsx = "psyq_aspsx_assemble_2_81_overlays"
else:
aspsx = "psyq_aspsx_assemble_44_overlays"
elif "mts/" in cFile or "SD/" in cFile:
elif "mts/" in cFile or "sd/" in cFile:
aspsx = "psyq_aspsx_assemble_2_56"
elif args.variant == 'vr_exe':
aspsx = "psyq_aspsx_assemble_2_81"

View File

@ -17,26 +17,26 @@ Instructions:
to create a new profile that you can call psx.prf.
Remove all the source files and options, then individually add each header file in src and its subfolders to the
Remove all the source files and options, then individually add each header file in source and its subfolders to the
list of source files to parse and use the following parse options, replacing Path/to/ as appropriate and adding any
folders that might be missing from the list. Note that on Linux, you might be required to make all the filenames in
the PsyQ INCLUDE and INCLUDE/SYS folders lowercase, as well as the INCLUDE/SYS folder name itself.
-IPath/to/mgs_reversing/src
-IPath/to/mgs_reversing/src/Equip
-IPath/to/mgs_reversing/src/Font
-IPath/to/mgs_reversing/src/Game
-IPath/to/mgs_reversing/src/libdg
-IPath/to/mgs_reversing/src/libgcl
-IPath/to/mgs_reversing/src/libgv
-IPath/to/mgs_reversing/src/map
-IPath/to/mgs_reversing/src/memcard
-IPath/to/mgs_reversing/src/Menu
-IPath/to/mgs_reversing/src/mts
-IPath/to/mgs_reversing/src/Okajima
-IPath/to/mgs_reversing/src/Thing
-IPath/to/mgs_reversing/src/util
-IPath/to/mgs_reversing/src/Weapon
-IPath/to/mgs_reversing/source
-IPath/to/mgs_reversing/source/equip
-IPath/to/mgs_reversing/source/font
-IPath/to/mgs_reversing/source/game
-IPath/to/mgs_reversing/source/libdg
-IPath/to/mgs_reversing/source/libgcl
-IPath/to/mgs_reversing/source/libgv
-IPath/to/mgs_reversing/source/libhzd
-IPath/to/mgs_reversing/source/memcard
-IPath/to/mgs_reversing/source/menu
-IPath/to/mgs_reversing/source/mts
-IPath/to/mgs_reversing/source/okajima
-IPath/to/mgs_reversing/source/takabe
-IPath/to/mgs_reversing/source/thing
-IPath/to/mgs_reversing/source/weapon
-IPath/to/psyq_sdk/psyq_4.3/include
-Dmips1
-D__GNUC__
@ -97,7 +97,7 @@ def strip_braces(string):
defined_data_ranges = []
updated_keys = set()
for root, subdirs, files in os.walk(root_dir + '/src'):
for root, subdirs, files in os.walk(root_dir + '/source'):
for filename in files:
file_path = os.path.join(root, filename)

View File

@ -40,7 +40,7 @@ with open(root_dir + '/obj/asm.map') as mapfile:
analyzed_funcs = []
with open(root_dir + '/build/ghidra_scripts/update_functions.log', 'w') as logfile:
for root, subdirs, files in os.walk(root_dir + '/src'):
for root, subdirs, files in os.walk(root_dir + '/source'):
for filename in files:
filepath = os.path.join(root, filename)

View File

@ -7,7 +7,7 @@ from include_asm_preprocess import FUNC_SIZES
# appends comment with byte size of func to all INCLUDE_ASM pragmas
PRAGMA_RE = r'^#pragma\s+INCLUDE_ASM\s*\(\s*"([^"]+)"\s*\).*$'
sources = glob('../src/**/*.c', recursive=True)
sources = glob('../source/**/*.c', recursive=True)
for c in sources:
processed = []

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ import sys
import re
# merge a range of lines in linker_command_file.txt into one .c file using INCLUDE_ASM for .s
# args: <linker line first> <linker line last> <../src/file.c>
# args: <linker line first> <linker line last> <../source/file.c>
ADDR_RE = r'_([0-9A-F]{8})\.'
INCLUDE_RE = r'^\s*include\s*"([^"]+)".*$'
@ -48,7 +48,7 @@ for i in range(start_line_no, end_line_no+1):
print("Process line: " + stripped)
path = m.group(1)
c = path.replace('.obj', '.c').replace('obj\\', 'src\\')
c = path.replace('.obj', '.c').replace('obj\\', 'source\\')
s = path.replace('.obj', '.s').replace('obj\\', 'asm\\')
c = c.replace('\\', '/')
@ -91,7 +91,7 @@ for i in reversed(range(start_line_no+1, end_line_no+1)):
out_file_obj = '..\\obj\\{}.obj'.format(out_file.replace('/', '\\'))
out_file_obj = out_file_obj.replace(".c.obj", ".obj")
out_file_obj = out_file_obj.replace("..\\src\\", "")
out_file_obj = out_file_obj.replace("..\\source\\", "")
lines[start_line_no] = '\n include "{}"\n'.format(out_file_obj)

View File

@ -15,7 +15,7 @@ def is_src_file(file):
def get_all_source_files():
global root
srcFiles = []
for root, dirs, files in os.walk(root + "\\src"):
for root, dirs, files in os.walk(root + "\\source"):
for file in files:
if is_src_file(file):
srcFiles.append(os.path.join(root, file))

View File

@ -39,7 +39,7 @@ def main():
for f in glob('../asm/**/*', recursive=True):
file_replace(f, before, after)
for f in glob('../src/**/*', recursive=True):
for f in glob('../source/**/*', recursive=True):
file_replace(f, before, after)
for f in glob('../build/linker_command_file.txt'):

View File

@ -71,7 +71,7 @@ def main():
f.writelines(l.replace(f"{prefix}_{original_addr}", f"{prefix}_{split_address:08X}") for l in header)
f.writelines(part2)
for f in glob('../src/**/*', recursive=True):
for f in glob('../source/**/*', recursive=True):
patch_file(f, f"{prefix}_{original_addr}", f"{prefix}_{split_address:08X}")
for f in glob('../build/linker_command_file.txt'):