diff --git a/.github/workflows/Linux_build.yml b/.github/workflows/Linux_build.yml index 1898e7ae4..e818903b3 100644 --- a/.github/workflows/Linux_build.yml +++ b/.github/workflows/Linux_build.yml @@ -63,7 +63,7 @@ jobs: sudo apt-get -y update sudo apt-get -y install clang-format-$LLVM_VERSION - name: Lint - run: ./xenia-build lint --all + run: ./xenia-build.py lint --all build-clang: name: Build (Clang ${{ matrix.LLVM_VERSION }}) @@ -85,12 +85,12 @@ jobs: sudo apt-add-repository "deb http://apt.llvm.org/${UBUNTU_BASE}/ llvm-toolchain-${UBUNTU_BASE}-${{ matrix.LLVM_VERSION }} main" sudo apt-get -y update sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-${{ matrix.LLVM_VERSION }} ninja-build - ./xenia-build setup + ./xenia-build.py setup - name: Build env: CC: clang-${{ matrix.LLVM_VERSION }} CXX: clang++-${{ matrix.LLVM_VERSION }} - run: ./xenia-build build --config=Release + run: ./xenia-build.py build --config=Release - name: Prepare artifacts id: prepare_artifacts run: | @@ -123,13 +123,13 @@ jobs: # run: | # sudo apt-get -y update # sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev g++-${{ matrix.GCC_VERSION }} -# ./xenia-build setup +# ./xenia-build.py setup # - name: Build # env: # CC: gcc-${{ matrix.GCC_VERSION }} # CXX: g++-${{ matrix.GCC_VERSION }} # # AR: ar -# run: ./xenia-build build --config=Release +# run: ./xenia-build.py build --config=Release # - name: Prepare artifacts # id: prepare_artifacts # run: | diff --git a/.github/workflows/Windows_build.yml b/.github/workflows/Windows_build.yml index 8be38ff5a..2c1bb161b 100644 --- a/.github/workflows/Windows_build.yml +++ b/.github/workflows/Windows_build.yml @@ -56,7 +56,7 @@ jobs: steps: - uses: actions/checkout@main - name: Lint - run: .\xb lint --all + run: .\xenia-build.py lint --all build: name: Build @@ -69,9 +69,9 @@ jobs: with: fetch-depth: 0 - name: Setup - run: .\xb setup + run: .\xenia-build.py setup - name: Build - run: .\xb build --no_premake --config=Release --target=src\xenia-app + run: .\xenia-build.py build --no_premake --config=Release --target=src\xenia-app - name: Prepare artifacts id: prepare_artifacts run: | diff --git a/src/xenia/cpu/ppc/ppc_opcode.h b/src/xenia/cpu/ppc/ppc_opcode.h index 2a27a09ed..27eabc22d 100644 --- a/src/xenia/cpu/ppc/ppc_opcode.h +++ b/src/xenia/cpu/ppc/ppc_opcode.h @@ -1,4 +1,4 @@ -// This code was autogenerated by ./tools/ppc-table-gen. Do not modify! +// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify! // clang-format off #ifndef XENIA_CPU_PPC_PPC_OPCODE_H_ #define XENIA_CPU_PPC_PPC_OPCODE_H_ diff --git a/src/xenia/cpu/ppc/ppc_opcode_disasm_gen.cc b/src/xenia/cpu/ppc/ppc_opcode_disasm_gen.cc index a66c4c2a2..c288e649b 100644 --- a/src/xenia/cpu/ppc/ppc_opcode_disasm_gen.cc +++ b/src/xenia/cpu/ppc/ppc_opcode_disasm_gen.cc @@ -1,4 +1,4 @@ -// This code was autogenerated by ./tools/ppc-table-gen. Do not modify! +// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify! // clang-format off #include #include @@ -5407,7 +5407,7 @@ static constexpr PPCOpcodeDisasmInfo ppc_opcode_disasm_table[] = { INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral, "XOR" , (PPCOpcodeField::kRS,PPCOpcodeField::kRB), (PPCOpcodeField::kRA,PPCOpcodeField::kCRcond), PrintDisasm_xorx), }; #undef INSTRUCTION -static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen"); +static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py"); const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) { return ppc_opcode_disasm_table[static_cast(opcode)]; diff --git a/src/xenia/cpu/ppc/ppc_opcode_lookup_gen.cc b/src/xenia/cpu/ppc/ppc_opcode_lookup_gen.cc index c43a26f28..5bd6b378a 100644 --- a/src/xenia/cpu/ppc/ppc_opcode_lookup_gen.cc +++ b/src/xenia/cpu/ppc/ppc_opcode_lookup_gen.cc @@ -1,4 +1,4 @@ -// This code was autogenerated by ./tools/ppc-table-gen. Do not modify! +// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify! // clang-format off #include #include diff --git a/src/xenia/cpu/ppc/ppc_opcode_table_gen.cc b/src/xenia/cpu/ppc/ppc_opcode_table_gen.cc index 22c41b270..62ef24745 100644 --- a/src/xenia/cpu/ppc/ppc_opcode_table_gen.cc +++ b/src/xenia/cpu/ppc/ppc_opcode_table_gen.cc @@ -1,4 +1,4 @@ -// This code was autogenerated by ./tools/ppc-table-gen. Do not modify! +// This code was autogenerated by ./tools/ppc-table-gen.py. Do not modify! // clang-format off #include #include @@ -471,7 +471,7 @@ PPCOpcodeInfo ppc_opcode_table[] = { INSTRUCTION(0x7c000278, "xorx" , kX , kI, kGeneral), }; #undef INSTRUCTION -static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen"); +static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py"); const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) { return ppc_opcode_table[static_cast(opcode)]; diff --git a/src/xenia/cpu/ppc/testing/README.md b/src/xenia/cpu/ppc/testing/README.md index 7bb2f52e2..597ee2f2b 100644 --- a/src/xenia/cpu/ppc/testing/README.md +++ b/src/xenia/cpu/ppc/testing/README.md @@ -5,10 +5,10 @@ runner. Each test is structured as a source `[name].s` PPC assembly file and the generated outputs. The outputs are made using the custom build of binutils -setup when `xenia-build gentests` is called and are checked in to make it easier +setup when `xb gentests` is called and are checked in to make it easier to run the tests on Windows. -Tests are run using the `xenia-test` app or via `xenia-build test`. +Tests are run using the `xenia-test` app or via `xb test`. ## Execution diff --git a/tools/build/premake b/tools/build/premake.py similarity index 98% rename from tools/build/premake rename to tools/build/premake.py index b9f423dee..baa2b890b 100644 --- a/tools/build/premake +++ b/tools/build/premake.py @@ -33,14 +33,14 @@ def setup_premake_path_override(): # its repository. # On Termux, the home directory is in the internal storage - use it for # executing. - # If xenia-build doesn't have execute permissions, Xenia is in the external + # If xenia-build.py doesn't have execute permissions, Xenia is in the external # storage now. try: popen = subprocess.Popen( ['uname', '-o'], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, universal_newlines=True) if popen.communicate()[0] == 'Android\n': - xb_file = os.path.join(root_path, 'xenia-build') + xb_file = os.path.join(root_path, 'xenia-build.py') if (os.path.isfile(xb_file) and not os.access(xb_file, os.X_OK) and 'HOME' in os.environ): premake_path = os.path.join( diff --git a/tools/gpu-trace-diff b/tools/gpu-trace-diff.py similarity index 98% rename from tools/gpu-trace-diff rename to tools/gpu-trace-diff.py index a2dcf67b9..33b1eefb9 100644 --- a/tools/gpu-trace-diff +++ b/tools/gpu-trace-diff.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 # Copyright 2015 Ben Vanik. All Rights Reserved. @@ -40,7 +40,7 @@ def main(): return # Setup main argument parser and common arguments. - parser = argparse.ArgumentParser(prog='gpu-trace-diff', + parser = argparse.ArgumentParser(prog='gpu-trace-diff.py', description='Run and diff GPU traces.') parser.add_argument( '-x', '--executable', diff --git a/tools/ppc-table-gen b/tools/ppc-table-gen.py similarity index 99% rename from tools/ppc-table-gen rename to tools/ppc-table-gen.py index 2375b0217..beb517def 100644 --- a/tools/ppc-table-gen +++ b/tools/ppc-table-gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python3 # Copyright 2015 Ben Vanik & shuffle2. All Rights Reserved. @@ -217,7 +217,7 @@ def generate_table(insns): for i in insns: w1(fmt % (i.opcode, i.mnem, i.form, i.group, i.type)) w0('};') - w0('static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");') + w0('static_assert(sizeof(ppc_opcode_table) / sizeof(PPCOpcodeInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");') w0('') w0('const PPCOpcodeInfo& GetOpcodeInfo(PPCOpcode opcode) {') w1('return ppc_opcode_table[static_cast(opcode)];') @@ -379,7 +379,7 @@ def generate_disasm(insns): ('PrintDisasm_' + literal_mnem(i.mnem)) if i.disasm_str else 'nullptr', )) w0('};') - w0('static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen");') + w0('static_assert(sizeof(ppc_opcode_disasm_table) / sizeof(PPCOpcodeDisasmInfo) == static_cast(PPCOpcode::kInvalid), "PPC table mismatch - rerun ppc-table-gen.py");') w0('') w0('const PPCOpcodeDisasmInfo& GetOpcodeDisasmInfo(PPCOpcode opcode) {') w1('return ppc_opcode_disasm_table[static_cast(opcode)];') diff --git a/xb b/xb index e841366c6..76cdf5114 120000 --- a/xb +++ b/xb @@ -1 +1 @@ -xenia-build \ No newline at end of file +xenia-build.py diff --git a/xb.bat b/xb.bat index f768840a3..8b7646fd2 100644 --- a/xb.bat +++ b/xb.bat @@ -1,5 +1,5 @@ @ECHO OFF -REM Copyright 2022 Ben Vanik. All Rights Reserved. +REM Copyright 2025 Ben Vanik. All Rights Reserved. SET "DIR=%~dp0" @@ -17,10 +17,10 @@ IF %_RESULT% NEQ 0 ( REM ============================================================================ -REM Trampoline into xenia-build +REM Trampoline into xenia-build.py REM ============================================================================ -"%PYTHON_EXE%" "%DIR%\xenia-build" %* +"%PYTHON_EXE%" "%DIR%\xenia-build.py" %* EXIT /b %ERRORLEVEL% diff --git a/xb.ps1 b/xb.ps1 index d5afc9bb5..6b5e69094 100644 --- a/xb.ps1 +++ b/xb.ps1 @@ -12,4 +12,4 @@ if (!$pythonPath) { Throw "ERROR: Python 3.9+ 64-bit must be installed and on PATH:`nhttps://www.python.org/" } -& $pythonPath "$($PSScriptRoot)/xenia-build" $args +& $pythonPath "$($PSScriptRoot)/xenia-build.py" $args diff --git a/xenia-build b/xenia-build.py old mode 100755 new mode 100644 similarity index 99% rename from xenia-build rename to xenia-build.py index ae4e86625..c6f490628 --- a/xenia-build +++ b/xenia-build.py @@ -151,7 +151,7 @@ def main(): f"https://github.com/xenia-canary/xenia-canary/blob/{default_branch}/docs/building.md") # Setup main argument parser and common arguments. - parser = ArgumentParser(prog="xenia-build") + parser = ArgumentParser(prog="xenia-build.py") # Grab all commands and populate the argument parser for each. subparsers = parser.add_subparsers(title="subcommands", @@ -504,7 +504,7 @@ def run_premake(target_os, action, cc=None): """ args = [ sys.executable, - os.path.join("tools", "build", "premake"), + os.path.join("tools", "build", "premake.py"), "--file=premake5.lua", f"--os={target_os}", #"--test-suite-mode=combined", @@ -1386,7 +1386,7 @@ class GpuTestCommand(BaseBuildCommand): any_failed = False result = shell_call([ sys.executable, - os.path.join(self_path, "tools", "gpu-trace-diff"), + os.path.join(self_path, "tools", "gpu-trace-diff.py"), f"--executable={test_executables[0]}", f"--trace_path={os.path.join(reference_trace_root, 'traces')}", f"--output_path={output_path}",