2024-01-14 14:32:13 -07:00
@page compiling Installing mk64 Decomp
2024-01-19 17:23:52 -07:00
# Build Instructions
2024-01-13 18:32:53 -07:00
The build system has the following package requirements:
binutils-mips >= 2.27
python3 >= 3.6
libaudiofile
2024-01-19 17:23:52 -07:00
[TOC]
2024-01-14 14:32:13 -07:00
2024-01-13 18:32:53 -07:00
To add submodules run `git submodule update --init --recursive` after cloning.
2024-04-09 21:29:57 -06:00
Run `make assets` to extract assets.
2024-01-19 17:23:52 -07:00
# Linux
2024-08-23 02:20:13 +02:00
### Ubuntu
2024-01-21 05:24:05 +01:00
``` bash
2024-04-09 21:29:57 -06:00
sudo apt install cmake build-essential pkg-config git binutils-mips-linux-gnu python3 zlib1g-dev libaudiofile-dev libcapstone-dev
2024-01-13 18:32:53 -07:00
```
2024-08-23 02:20:13 +02:00
### Fedora
``` bash
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake pkg-config git python3 zlib-devel audiofile-devel capstone
```
and install [gcc toolchain of libdragon ](https://github.com/DragonMinded/libdragon/releases/tag/toolchain-continuous-prerelease ) and add `export PATH="/opt/libdragon/bin:$PATH"` to ~/.bashrc
2024-01-14 14:32:13 -07:00
### Arch
2024-01-13 18:32:53 -07:00
2024-01-21 05:24:05 +01:00
``` bash
2024-01-13 18:32:53 -07:00
sudo pacman -S base-devel capstone python
```
2024-01-14 14:32:13 -07:00
Install the following AUR package:
2024-01-13 18:32:53 -07:00
* [mips64-elf-binutils ](https://aur.archlinux.org/packages/mips64-elf-binutils ) (AUR)
2024-01-14 14:32:13 -07:00
Review the [n64decomp/sm64 ](https://github.com/n64decomp/sm64 ) readme for instructions to compile in other distributions.
2024-01-13 18:32:53 -07:00
2024-01-19 17:23:52 -07:00
# Windows
2024-01-13 18:32:53 -07:00
2024-02-22 18:43:17 -07:00
- Clone the repo or download the zip.
2024-04-17 00:51:34 +02:00
- Download and extract the toolchain from [here ](https://github.com/coco875/mk64-tools/releases/download/v0.0.8/mips-tools-chain-windows.zip )
2024-02-22 16:33:46 +01:00
### Setup
2024-02-22 18:43:17 -07:00
- Place the `mingw64` folder from the toolchain into the tools folder like so: `mk64/tools/mingw64` .
2024-04-13 02:54:59 +02:00
- Open a terminal (cmd or powershell) in the repo folder and run `"tools\mingw64\w64devkit.exe"` and after `make assets && make -j`
2024-02-22 18:43:17 -07:00
- Wait for the build to finish and Enjoy!
2024-01-13 18:32:53 -07:00
2024-01-19 17:23:52 -07:00
# macOS
2024-01-13 18:32:53 -07:00
Install [Homebrew ](https://brew.sh ), then install the following dependencies:
2024-01-21 05:24:05 +01:00
``` bash
2024-01-13 18:32:53 -07:00
brew update
brew install python3 capstone coreutils make pkg-config tehzz/n64-dev/mips64-elf-binutils
```
2024-01-14 14:32:13 -07:00
Build using `gmake` ensuring homebrew `make` is used instead of the old macOS system `make` .
2024-01-13 18:32:53 -07:00
2024-01-19 17:23:52 -07:00
# Docker
2024-01-13 18:32:53 -07:00
Build the Docker image:
2024-01-21 05:24:05 +01:00
``` bash
2024-01-13 18:32:53 -07:00
docker build -t mk64 .
```
When building and using other tools, append the following in front of every command you run:
``` bash
2024-01-21 05:24:05 +01:00
docker run --rm -v .:/mk64 mk64
2024-01-13 18:32:53 -07:00
```
For example:
``` bash
2024-01-21 05:24:05 +01:00
docker run --rm -v .:/mk64 mk64 make
2024-01-13 18:32:53 -07:00
```
2024-01-19 17:23:52 -07:00
# Building US
2024-01-13 18:32:53 -07:00
Place a US version of Mario Kart 64 called `baserom.us.z64` into the project folder for asset extraction.
Run the following commands after pulling:
``` bash
2024-01-14 14:32:13 -07:00
make -j
```
2024-01-19 17:23:52 -07:00
# Building EU
2024-01-14 14:32:13 -07:00
Building EU requires US to be built first. See above.
mk64 decomp supports two EU versions
* EU 1.0 `eu-1.0`
* EU 1.1 `eu-final`
Build using
2024-01-21 05:24:05 +01:00
``` bash
2024-01-14 14:32:13 -07:00
make -j VERSION = eu-1.0
```
or
2024-01-21 05:24:05 +01:00
``` bash
2024-01-14 14:32:13 -07:00
make -j VERSION = eu-final
```
First-diff/diff commands for EU
2024-01-21 05:24:05 +01:00
``` bash
2024-01-14 14:32:13 -07:00
python3 first-diff.py --eu
./diff <function > -eu
2024-01-13 18:32:53 -07:00
```