Warning: The build system has been only tested on Windows 10 with WSL1, using the Windows file system. Other environments might work as compatibility measures were copied from pokemon_dp, but none have been tested and there is no guarantee that they will work.
First, create an environment variable called LM_LICENSE_FILE
with its value as the planned path to the license file in the repository, at /sdk/cw/license.dat
. For example, if you plan to store the repository at C:\Users\<user>\Desktop\retsam_00jupc, where <user> is your Windows username, then the value of LM_LICENSE_FILE
should be C:\Users\<user>\Desktop\retsam_00jupc\sdk\cw\license.dat
.
To add an environment variable:
- Search for "environment variables" in Windows 10's Start Search, and click the option that says "Edit the system environment variables".
- In the window that opens, click the button that says "Environment Variables..." on the bottom right.
- In the window that opens, click "New..." on the bottom right.
- Input in the environment variable name and value, then click "OK".
You will need to restart your computer for the changes to take effect, but if you plan to use Windows Subsystem for Linux (WSL), then you can restart later as part of the required restart when installing WSL.
-
Open Windows Powershell as Administrator, and run the following command (Right Click or Shift+Insert is paste in the Powershell).
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
-
Once the process finishes, restart your machine.
-
The next step is to choose and install a Linux distribution from the Microsoft Store. The following instructions will assume Ubuntu as the Linux distribution of choice.
-
Open the Microsoft Store Linux Selection, click Ubuntu, then click Get, which will install the Ubuntu distribution.
Notes...
Note 1: If a dialog pops up asking for you to sign into a Microsoft Account, then just close the dialog.
Note 2: If the link does not work, then open the Microsoft Store manually, and search for the Ubuntu app (choose the one with no version number).
Some tips before proceeding:
- In WSL, Copy and Paste is either done via
- right-click (selection + right click to Copy, right click with no selection to Paste)
- Ctrl+Shift+C/Ctrl+Shift+V (enabled by right-clicking the title bar, going to Properties, then checking the checkbox next to "Use Ctrl+Shift+C/V as Copy/Paste").
- Some of the commands that you'll run will ask for your WSL password and/or confirmation to perform the stated action. This is to be expected, just enter your WSL password and/or the yes action when necessary.
-
Open Ubuntu (e.g. using Search).
-
WSL/Ubuntu will set up its own installation when it runs for the first time. Once WSL/Ubuntu finishes installing, it will ask for a username and password (to be input in).
Note...
When typing in the password, there will be no visible response, but the terminal will still read in input.
-
Update WSL/Ubuntu before continuing. Do this by running the following command. These commands will likely take a long time to finish:
sudo apt update && sudo apt upgrade
-
Certain packages are required to build the repository. Install these packages by running the following command:
sudo apt-get install git gcc make bison flex bzip2
-
Change to a directory accessible from Windows where you'll store the files, for example:
cd /mnt/c/Users/$USER/Desktop
Continue with the building instructions
Cygwin is not recommended. While not tested, it is believed to run extremely slowly compared to WSL1.
Get the installer (64 bit or 32 bit). Grab the setup script (64 bit or 32 bit).
Place these files next to each other and run the batch file. Follow through the installation, there's no need to select any additional packages.
Change to a directory accessible from Windows where you'll store the files, for example:
cd /cygdrive/c/Users/$USER/Desktop
Continue with the building instructions
You need to install the following software:
- git
- gcc
- make
- bison
- flex
- wine (with 32-bit support!)
On Debian or Ubuntu you can do this by running:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install git gcc make bison flex wine32
Continue with the building instructions
Clone the repository:
git clone <repo url> retsam_00jupc
cd retsam_00jupc
To build everything:
./build_all.sh -j
Passing -j
will cause make
to run with multiple jobs (faster with multiple CPU cores), but is entirely optional.
If everything works, then the following ROM should be built:
- bin/ARM9-TS/Rom/main.srl
sha1: ce81046eda7d232513069519cb2085349896dec7
Note for Windows users: Consider disabling real-time protection using these instructions to speed up builds. Adding an exception for the repository folder does not seem to help as much; one hypothesis is that the exceptions do not affect how various files are accessed via Windows (not WSL1) absolute paths.
To build only the Platinum specific source files (i.e. don't build tools or SDK source files), run:
./build_src.sh -j
To remove everything used in the build, run ./clean_all.sh
. To remove only code objects, run ./tidy_all.sh
.