Explanation

First of all we need the compiler, in fact cross-compiler. There are many different processor architectures, some used for PC, some for game consoles: for example the most common architecture for PC is x86. Compiler produces binary files from source code, and thats executable will run only on the same architecture which is compiler's too. If we need to produce executable for architecture, different from current, we need a cross-compiler.

PSone processor has MIPS architecture, which is supported by GCC - GNU compiler collection. So we need to build GCC that way, which we it will produce executables for mips.

Before starting

Here and below you must be logined as root. We need some directory where our crosscompiler will stored. The best choice is /usr/local/psxsdk because it makes PSXSDK installation more simple. So execute:

mkdir /usr/local/psxsdk

Installing binutils

Binutils - is set of tools for final stage of producing executables from source. We need the most recent version of it, for now it 2.22. It can be downloaded here: http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz .

Building will like this:

cd /tmp
wget http://ftp.gnu.org/gnu/binutils/binutils-2.22.tar.gz
tar -xzf binutils-2.22.tar.gz
cd binutils-2.22
./configure --prefix=/usr/local/psxsdk --target=mipsel-unknown-elf --with-float=soft
make && amke install

Before building GCC

GCC depends on this libraies: GMP, MPFR, MPC. In most cases they are already installed on your system, but if not do it via your package manager: aptitude, rpm or so. And not forget to install * -dev versions of this libs.

Getting GCC

You can download gcc here: ftp://ftp.gnu.org/gnu/gcc/ There is not very important which version you choose, they almost all will suit. For example I am using this: ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.5/gcc-4.4.5.tar.bz2

Execute:

cd /tmp
wget ftp://ftp.gnu.org/gnu/gcc/gcc-4.4.5/gcc-4.4.5.tar.bz2
tar -xjf gcc-4.4.5.tar.bz2

Building GCC

You need around 1 GB of free space to build GCC. First of all you need to create directory for build process - yes building a gcc is a little tricky.

mkdir /tmp/gcc-build
cd /tmp/gcc-build

YOU MUST BE IN THIS DIRECTORY, NOT IN DIRECTORY WHERE YOU UNPACKED GCC !

Now configure sources appropriate to our target:

/tmp/gcc-4.4.5/configure --disable-libada --disable-libssp --target=mipsel-unknown-elf \
--prefix=/usr/local/psxsdk --with-float=soft --enable-languages=c

Now make:

make

Building will take a while. Install it when finished:

make install

Configuring paths

OS must know about this compiler, so we need to tell it about compiler path. I recommend to add this line to the end of your root ~/.profile file. And add this line to ~/.profile of user, under which you plan to develop games.

export PATH=$PATH:/usr/local/psxsdk/bin

Installing PSXSDK

Download psxsdk from this link: http://code.google.com/p/psxsdk/downloads/detail?name=psxsdk-20120303.tar.bz2&can=2&q= Unpack it to some directory and cd there.

If you are using debian system, make symlink make -> gmake:

ln -s make gmake

Now just run make:

make

And you have working PSXSDK now, I hope.

Hosted by uCoz