mirror of
https://github.com/zeldaret/ph
synced 2026-05-23 06:54:18 -04:00
Merge branch 'main' into match_actor_rupee
This commit is contained in:
+17
-11
@@ -64,7 +64,6 @@ libs_path = root_path / "libs"
|
||||
extract_path = root_path / "extract"
|
||||
tools_path = root_path / "tools"
|
||||
mwcc_path = tools_path / "mwccarm" / MWCC_VERSION
|
||||
mw_license_path = tools_path / "mwccarm" / "license.dat"
|
||||
|
||||
|
||||
# Includes
|
||||
@@ -81,20 +80,13 @@ CC_INCLUDES = " ".join(f"-i {include}" for include in includes)
|
||||
# Platform info
|
||||
EXE = ""
|
||||
WINE = ""
|
||||
MW_LICENSE_SHELL = ""
|
||||
system = platform.system()
|
||||
if system == "Windows":
|
||||
if system == "Windows" or system.startswith("MSYS") or system.startswith("MINGW"):
|
||||
system = "windows"
|
||||
EXE = ".exe"
|
||||
MW_LICENSE_SHELL = lambda cmd: f'cmd /s /c "set LM_LICENSE_FILE="{mw_license_path}" && cmd /s /c "&& {cmd}""'
|
||||
elif system.startswith("MSYS"):
|
||||
system = "msys"
|
||||
EXE = ".exe"
|
||||
MW_LICENSE_SHELL = lambda cmd: f"LM_LICENSE_FILE={mw_license_path} {cmd}"
|
||||
elif system == "Linux":
|
||||
system = "linux"
|
||||
WINE = args.wine
|
||||
MW_LICENSE_SHELL = lambda cmd: f"LM_LICENSE_FILE={mw_license_path} {cmd}"
|
||||
else:
|
||||
print(f"Unknown system '{system}'")
|
||||
exit(1)
|
||||
@@ -138,7 +130,7 @@ def main():
|
||||
|
||||
n.rule(
|
||||
name="mwcc",
|
||||
command=MW_LICENSE_SHELL(f'{WINE} "{mwcc_path}/mwccarm.exe" {CC_FLAGS} {CC_INCLUDES} $cc_flags -d $game_version $in -o $out')
|
||||
command=f'{WINE} "{mwcc_path}/mwccarm.exe" {CC_FLAGS} {CC_INCLUDES} $cc_flags -d $game_version $in -o $out'
|
||||
)
|
||||
n.newline()
|
||||
|
||||
@@ -150,7 +142,7 @@ def main():
|
||||
|
||||
n.rule(
|
||||
name="mwld",
|
||||
command=MW_LICENSE_SHELL(f'{WINE} "{mwcc_path}/mwldarm.exe" {LD_FLAGS} @$objects_file $lcf_file -o $out')
|
||||
command=f'{WINE} "{mwcc_path}/mwldarm.exe" {LD_FLAGS} @$objects_file $lcf_file -o $out'
|
||||
)
|
||||
n.newline()
|
||||
|
||||
@@ -241,6 +233,13 @@ def add_mwld_and_rom_builds(n: ninja_syntax.Writer, game_build: Path, game_confi
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.build(
|
||||
inputs=rom_file,
|
||||
rule="phony",
|
||||
outputs="rom",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
|
||||
def add_mwcc_builds(n: ninja_syntax.Writer, game_version: str, game_build: Path):
|
||||
for source_file in get_c_cpp_files([src_path, libs_path]):
|
||||
@@ -327,6 +326,13 @@ def add_delink_and_lcf_builds(n: ninja_syntax.Writer, game_config: Path, game_bu
|
||||
)
|
||||
n.newline()
|
||||
|
||||
n.build(
|
||||
inputs="objdiff.json",
|
||||
rule="phony",
|
||||
outputs="objdiff",
|
||||
)
|
||||
n.newline()
|
||||
|
||||
|
||||
def get_config_files(game_config: Path, name: str):
|
||||
return [
|
||||
|
||||
+14
-14
@@ -2,25 +2,25 @@ import requests
|
||||
import zipfile
|
||||
import io
|
||||
from pathlib import Path
|
||||
import shutil
|
||||
import platform
|
||||
|
||||
DSD_VERSION = 'v0.1.0'
|
||||
DSD_VERSION = 'v0.2.0'
|
||||
|
||||
|
||||
tools_path = Path(__file__).parent
|
||||
deps_path = tools_path / 'deps'
|
||||
if not deps_path.exists(): deps_path.mkdir()
|
||||
root_path = tools_path.parent
|
||||
|
||||
|
||||
exe_extension = ''
|
||||
match platform.system():
|
||||
case 'Windows': system = 'windows'; exe_extension = '.exe'
|
||||
case 'Linux': system = 'linux'
|
||||
case system:
|
||||
print(f'Unknown system "{system}"')
|
||||
exit(1)
|
||||
EXE = ""
|
||||
system = platform.system()
|
||||
if system == "Windows" or system.startswith("MSYS") or system.startswith("MINGW"):
|
||||
system = "windows"
|
||||
EXE = ".exe"
|
||||
elif system == "Linux":
|
||||
system = "linux"
|
||||
else:
|
||||
print(f"Unknown system '{system}'")
|
||||
exit(1)
|
||||
match platform.machine().lower():
|
||||
case 'amd64' | 'x86_64': machine = 'x86_64'
|
||||
case machine:
|
||||
@@ -29,13 +29,13 @@ match platform.machine().lower():
|
||||
|
||||
|
||||
print('\nInstalling dsd...')
|
||||
response = requests.get(f'https://github.com/AetiasHax/ds-decomp/releases/download/{DSD_VERSION}/dsd-{system}-{machine}{exe_extension}')
|
||||
with open(root_path / f'dsd{exe_extension}', 'wb') as f:
|
||||
response = requests.get(f'https://github.com/AetiasHax/ds-decomp/releases/download/{DSD_VERSION}/dsd-{system}-{machine}{EXE}')
|
||||
with open(root_path / f'dsd{EXE}', 'wb') as f:
|
||||
f.write(response.content)
|
||||
|
||||
|
||||
print('\nInstalling toolchain...')
|
||||
response = requests.get('http://decomp.aetias.com/mwccarm.zip')
|
||||
response = requests.get('http://decomp.aetias.com/files/mwccarm.zip')
|
||||
zip_file = zipfile.ZipFile(io.BytesIO(response.content))
|
||||
zip_file.extractall(tools_path)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user