Cleaned up build setup

This commit is contained in:
AnonymousRandomPerson 2023-08-15 22:29:36 -04:00
parent f906aa056f
commit 1ba6f179e6
5 changed files with 29 additions and 52 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash -ex
# Only run this script if it's the master branch build.
if [[ "$GITHUB_REF" != "refs/heads/master" || "$GITHUB_EVENT_NAME" != "push" ]]; then
# Only run this script if it's the main branch build.
if [[ "$GITHUB_REF" != "refs/heads/main" || "$GITHUB_EVENT_NAME" != "push" ]]; then
exit 0
fi

View File

@ -2,7 +2,7 @@ name: build
on:
push:
branches: [ master ]
branches: [ main ]
pull_request:
workflow_dispatch:
@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Update and Install Software
- name: Update and install software
run: |
sudo apt update
sudo ACCEPT_EULA=Y apt -y --fix-missing --allow-downgrades upgrade
@ -34,10 +34,10 @@ jobs:
sudo apt update
sudo apt -y --allow-downgrades install --install-recommends winehq-stable
- name: Checkout Repo
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Repo
- name: Set up repo
run: |
mkdir -p ~/download
cd ~/download
@ -80,7 +80,7 @@ jobs:
- name: Checkout xMAP
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@master
uses: actions/checkout@main
with:
path: 'xmap'
ref: 'xmap'

View File

@ -1,22 +1,22 @@
This doc details the steps necessary to build a copy of _Pokémon Mystery Dungeon: Explorers of Sky_ (EN-US) from the sources contained in this repository.
### 0. Clone the repository
## 0. Clone the repository
Using a terminal or git client, clone this repository to your local device. All the steps that followed should be performed in the directory to which you cloned this repository.
Using a terminal or Git client, clone this repository to your local device. All the steps that followed should be performed in the directory to which you cloned this repository.
### 1. Install MWCC compiler
## 1. Install MWCC compiler
The build system requires the use of the Metrowerks C Compiler versions 2.0/sp2p2 to compile matching files. We cannot distribute the correct compiler here so join the PRET discord and download the pinned mwccarm.zip zip in #pokediamond and extract it to tools/. At the end of this operation, you should have i.e. the file `tools/mwccarm/2.0/sp2p2/mwccarm.exe`. Run each of the executables so they ask for a license.dat and provide the one in the rar (it may also ask for it when compiling). This only needs to be done once.
The build system requires the use of the Metrowerks C Compiler versions 2.0/sp2p2 to compile matching files. We cannot distribute the correct compiler here, so join the PRET Discord, download the pinned `mwccarm.zip` zip in `#pokediamond`, and extract it to `tools/`. At the end of this operation, you should have the file `tools/mwccarm/2.0/sp2p2/mwccarm.exe`. Run each of the executables so they ask for a `license.dat`, and provide the one in the zip (it may also ask for it when compiling). This only needs to be done once.
In the future, a GCC option will be available so MWCC is not required to build, however it is required for a matching ROM.
In the future, a GCC option will be available so MWCC is not required to build; however, it is required for a matching ROM.
### 2. Install Nitro SDK
## 2. Install Nitro SDK
As with the compiler, the Nitro SDK is proprietary and cannot be distributed here. Download the "NitroSDK-4_2-071210-jp.7z" file pinned in the PRET discord. Extract and copy the folder `tools/bin` from the Nitro SDK into the folder `tools` in your pmd-sky clone. At the end of this operation, you should have i.e. the file `tools/bin/makelcf.exe` inside your pmd-sky clone. Finally, copy include/nitro/specfiles/ARM7-TS.lcf.template into the subdirectory `sub`, and include/nitro/specfiles/ARM9-TS.lcf.template and include/nitro/specfiles/mwldarm.response.template into the project root.
As with the compiler, the Nitro SDK is proprietary and cannot be distributed here. Download the `NitroSDK-4_2-071210-jp.7z` file pinned in the PRET Discord. Extract and copy the folder `tools/bin` from the Nitro SDK into the folder `tools` in your `pmd-sky` clone. At the end of this operation, you should have the file `tools/bin/makelcf.exe` inside your `pmd-sky` clone. Finally, copy `include/nitro/specfiles/ARM7-TS.lcf.template` into the subdirectory `sub`, and `include/nitro/specfiles/ARM9-TS.lcf.template` and `include/nitro/specfiles/mwldarm.response.template` into the project root.
### 3. Dependencies
## 3. Dependencies
#### Linux
### Linux
Building the ROM requires the following packages. If you cannot find one or more of these using your package distribution, it may be under a different name.
@ -30,13 +30,13 @@ Building the ROM requires the following packages. If you cannot find one or more
* pkg-config
* pugixml (libpugixml-dev on Ubuntu)
NOTE: If you are using Arch/Manjaro or Void you will only need base-devel instead of build-essentials or make or git. You will still need wine.
NOTE: If you are using Arch/Manjaro or Void, you will only need base-devel instead of build-essentials or make or git. You will still need wine.
Currently WSL2 has an issue with mwldarm not being able to locate it's executable. Please use WSL1 or another build environment to mitigate this issue until a solution is found.
Currently WSL2 has an issue with mwldarm not being able to locate its executable. Please use WSL1 or another build environment to mitigate this issue until a solution is found.
#### Windows
### Windows
Before following the respective guides, please install devkitARM and ensure the DEVKITPRO and DEVKITARM variables are added to bashrc such that:
Before following the respective guides, please install devkitARM and ensure the `DEVKITPRO` and `DEVKITARM` variables are added to `bashrc` such that:
Msys2:
```console
@ -63,7 +63,7 @@ Install them using either the Cygwin package manager or using pacman on Msys2.
**NOTE FOR MSYS2:** You will need to compile and install [libpng](https://www.libpng.org/pub/png/libpng.html) from source.
#### macOS
### macOS
macOS 10.15 Catalina and later is supported on Intel and ARM64 hardware configurations. On ARM64, Rosetta 2 must be installed, as well as the following dependencies:
@ -87,7 +87,7 @@ $ brew install coreutils make gnu-sed llvm arm-gcc-bin libpng git pkg-config
$ brew install wine-crossover
```
### 4. Build ROM
## 4. Build ROM
Run `make` to build the ROM. The ROM will be output as `build/pmdsky.us/pmdsky.us.nds`
@ -95,24 +95,13 @@ There are targets for building and testing changes to individual components with
At the end of building each of these, there is a checksum verification step. This makes sure that the final product is byte-for-byte equivalent to the retail ROM. To disable this, append `COMPARE=0` to your command.
#### Windows
### Windows
If you get an error in saving configuration settings when specifying the license file, you need to add a system environment variable called LM_LICENSE_FILE and point it to the license.dat file. Alternatively, run mwccarm.exe from an Administrator command prompt, PowerShell, or WSL session.
If you get an error in saving configuration settings when specifying the license file, you need to add a system environment variable called `LM_LICENSE_FILE` and point it to the `license.dat` file. Alternatively, run `mwccarm.exe` from an Administrator command prompt, PowerShell, or WSL session.
#### Docker
### After updating from upstream
If you find issues building the ROMs with the above methods, you can try the Docker-specific build script. It will build an Alpine-based Docker image with the system requirements above, and run the `make` scripts (any specified parameter will be passed to the `make` command):
```console
$ make clean
$ ./contrib/docker/build_docker.sh
```
Note: Docker may not run at a full performance if its underlying Linux kernel is being virtualized (mainly Windows and macOS hosts).
#### After updating from upstream
This repository is still in a volatile state, and several files may be moved around or renamed. If you pull from upstream and experience errors rebuilding, try the following troubleshooting steps, **one line at a time** until you get the message `build/pmdsky.us/pmdsky.us.nds: OK`:
This repository is still in a volatile state, and several files may be moved around or renamed. If you pull from upstream and experience errors rebuilding, try the following troubleshooting steps **one line at a time** until you get the message `build/pmdsky.us/pmdsky.us.nds: OK`:
```shell
make tidy && make compare

View File

@ -8607,17 +8607,6 @@ NITROFS_FILES := \
files/TOP/title_0.bgp \
files/TOP/title_1.bgp \
# TODO: file rules
# Some filenames are stripped and replaced with a serial number
# such that the XYZth file is mapped to a/X/Y/Z.
# Temporary names for now
define arc_strip_name
$(2): $(1)
SRC_ARCS += $(1)
DIFF_ARCS += $(2)
.PHONY: $(2)
endef
$(DIFF_ARCS):
cp $< $@
@ -8657,6 +8646,5 @@ endif
clean-fs: clean-filesystem
clean-filesystem:
$(RM) files/msgdata/msg/*.bin
$(RM) $(DIFF_ARCS) $(NAIXS)
$(RM) -r $(FS_CLEAN_TARGETS)

View File

@ -1,8 +1,8 @@
#########################################################################
### Linker spec file for Pokemon Mystery Dungeon: Explorers of Sky US ###
### Pass this to the SDK's makelcf.exe utility ###
### along with the ARM9-TS template. ###
### WIP ###
### Pass this to the SDK's makelcf.exe utility ###
### along with the ARM9-TS template. ###
### WIP ###
#########################################################################
Static main