Page 1 of 1

Compiling for the ps2?

Posted: Fri Mar 10, 2006 3:57 am
by fabjan
Hello everyone, my first post here.
I just got the toolchain on my linux boxxen, and it seems to be working.
I'm pretty new to programming in general though, and have no idea how makefiles work, so I can't decipher how it calls the compiler and what flags it passes. This makes it pretty hard to compile my own code.
I can compile the examples using make but I don't really know how the different processors work together. One sample I tried was cube, I moved the elf to my ps2 and it ran just fine, but the hello sample produces an .erl, how do those work?

So basically, what I'd like to know is:
  • How do I compile my code using the ps2sdk?
    How do I use the different processors?
It'd be great to hear from anyone on this!

Posted: Fri Mar 10, 2006 6:14 am
by JorDy
basicly to answer your first question you need this in your makefile in the same directory as you c files

EE_BIN = callstacktest.elf
EE_OBJS = callstacktest.o
EE_LIBS = -ldebug -lc
EE_LINK = debug/callstacktest
all: $(EE_BIN)

clean:
rm -f *.elf *.o *.a

include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal

the EE_BIN is the name of your elf you want to create
the EE_OBS is the c files names but with an o these are created once you compile
the EE_LIBS are the librarys you need to include for you project
EE_link is not always needed
clean is what file type are removed when you type "make clean"