mirror of
https://github.com/encounter/oot-gc.git
synced 2026-07-10 12:18:42 -07:00
Add support for Windows (#159)
* add support for windows * add crlf warning * add note for WSL * add git attributes from dtk template * review
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
# Auto detect text files and perform LF normalization
|
||||
* text=auto
|
||||
|
||||
# Explicitly declare text files
|
||||
*.py text
|
||||
|
||||
# Enforce platform-specific encodings
|
||||
*.bat text eol=crlf
|
||||
*.sh text eol=lf
|
||||
*.sha1 text eol=lf
|
||||
|
||||
# decomp-toolkit writes files with LF
|
||||
config/**/*.txt text eol=lf
|
||||
@@ -26,7 +26,7 @@ You will need the following dependencies:
|
||||
* wine (for macOS or non-x86 Linux)
|
||||
* clang-format (optional)
|
||||
|
||||
#### Ubuntu/Debian
|
||||
#### Ubuntu/Debian/Windows (WSL)
|
||||
|
||||
You can install the dependencies with the following commands:
|
||||
|
||||
@@ -44,6 +44,17 @@ brew install git ninja python3
|
||||
brew install --cask --no-quarantine gcenx/wine/wine-crossover
|
||||
```
|
||||
|
||||
#### Windows (Native)
|
||||
|
||||
You will need the following dependencies:
|
||||
- [ninja.exe](https://github.com/ninja-build/ninja/releases/latest)
|
||||
- Python (make sure to add it to your PATH during the installation)
|
||||
- [Git for Windows](https://www.git-scm.com/downloads)
|
||||
|
||||
You need to add ``C:\Program Files\Git\bin`` to your system's PATH (not the user one) in order to execute bash scripts properly.
|
||||
|
||||
To get objdiff to work properly you also need to add the path to the folder containing ``ninja.exe`` to the system's PATH.
|
||||
|
||||
### Instructions
|
||||
|
||||
1. Clone the repo using `git clone https://github.com/zeldaret/oot-gc`.
|
||||
@@ -61,7 +72,7 @@ brew install --cask --no-quarantine gcenx/wine/wine-crossover
|
||||
You can use [Dolphin](https://dolphin-emu.org) to perform both of these extraction steps:
|
||||
right click on the file you want to extract from, select `Properties`, and go to the `Filesystem` tab.
|
||||
|
||||
3. Run `python3 configure.py`.
|
||||
3. Run `python3 configure.py`. (Note: on Windows you might need to run ``python configure.py``.)
|
||||
|
||||
4. Run `ninja` to build the `ce-j` version, or run `ninja <version>` to build another version.
|
||||
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# bash scripts are executed with sh.exe, installed with Git for Windows, which is using MSYS
|
||||
OS=$(uname -o)
|
||||
PYTHON="python3"
|
||||
if [ "$OS" == "Msys" ]; then
|
||||
PYTHON="python"
|
||||
fi
|
||||
|
||||
CC="$1"
|
||||
shift
|
||||
AS="$1"
|
||||
@@ -18,9 +25,9 @@ trap "rm -rf $TEMP" EXIT
|
||||
STEM=$(basename "$IN")
|
||||
STEM="${STEM%.*}"
|
||||
|
||||
tools/asm_processor/asm_processor.py "$IN" > "$TEMP/$STEM.c"
|
||||
$PYTHON tools/asm_processor/asm_processor.py "$IN" > "$TEMP/$STEM.c"
|
||||
$CC "$TEMP/$STEM.c" -c -o "$TEMP"
|
||||
tools/asm_processor/asm_processor.py "$IN" --post-process "$TEMP/$STEM.o" --assembler "$AS" --asm-prelude include/macros.inc
|
||||
$PYTHON tools/asm_processor/asm_processor.py "$IN" --post-process "$TEMP/$STEM.o" --assembler "$AS" --asm-prelude include/macros.inc
|
||||
# Remove sections that don't work with our reloc hacks
|
||||
build/binutils/powerpc-eabi-objcopy --remove-section .mwcats.text --remove-section .comment "$TEMP/$STEM.o" "$OUT"
|
||||
# Copy depfile, replacing the first line with the correct input/output files
|
||||
|
||||
@@ -422,6 +422,8 @@ def generate_build_ninja(
|
||||
mwcc_implicit.append(transform_dep)
|
||||
mwcc_sjis_implicit.append(transform_dep)
|
||||
mwcc_asm_processor_implicit.append(transform_dep)
|
||||
else:
|
||||
mwcc_asm_processor_cmd = "sh " + mwcc_asm_processor_cmd
|
||||
|
||||
n.comment("Link ELF file")
|
||||
n.rule(
|
||||
|
||||
Reference in New Issue
Block a user