making .elf out of .o using GCC?
making .elf out of .o using GCC?
Hi, I'm new to GCC for the ps2.
I was wondering if anyone could tell me how to convert .o files into .elf files using GCC. I'm using the ps2Dev envirmonment variables (That big 30 MB installation version).
I have a simple program with nothing in it (int main(void){}) called main.c
I compile it using: ee-gcc -Tc:\ps2dev\ps2lib\ee\startup\linkfile -o main.o main.c
Now I've got my object file, HOW do I turn it into an .elf file?
Thanks in advance and sorry for the very simple question.
I was wondering if anyone could tell me how to convert .o files into .elf files using GCC. I'm using the ps2Dev envirmonment variables (That big 30 MB installation version).
I have a simple program with nothing in it (int main(void){}) called main.c
I compile it using: ee-gcc -Tc:\ps2dev\ps2lib\ee\startup\linkfile -o main.o main.c
Now I've got my object file, HOW do I turn it into an .elf file?
Thanks in advance and sorry for the very simple question.
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)
still stuck
Thanks for the help mr brown. But I've read all the make files and still I can't convert object files into .elf files.
Can somebody please help me convert .o files into .elf files using ee-gcc?
Thanks.
Can somebody please help me convert .o files into .elf files using ee-gcc?
Thanks.
Sorry, I didn't log in, but that is my post above.
Seriously guys, help will be very appreciated!
Seriously guys, help will be very appreciated!
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)
OT: ELF
And, strictly speaking, an object file (".o file") is "an elf file" too. It's an ELF relocatable, but it's not an ELF executable (which is what you wanted).
The ELF format (OK, this is redundant, since ELF stands for "Executable and Linking Format") is just an object container -- in addition to executable files and relocatable files, there are also shared libraries and probably other stuff too. Elf is a very nice container, as it's completely architecture-neutral; one file format for lots of things (exec, reloc, so), and lots of architecures (mips, x86, m68k, etc.) in both little-endian and big-endian format. Much nicer than the so-called "portable executable" that windows uses...
[I'm being pedantic here, of course, since everyone knows that in ps2dev parlance, "an .elf file" is generally taken to mean "A staticly-linked MIPS-5900 little-endian executable ELF file."]
The ELF format (OK, this is redundant, since ELF stands for "Executable and Linking Format") is just an object container -- in addition to executable files and relocatable files, there are also shared libraries and probably other stuff too. Elf is a very nice container, as it's completely architecture-neutral; one file format for lots of things (exec, reloc, so), and lots of architecures (mips, x86, m68k, etc.) in both little-endian and big-endian format. Much nicer than the so-called "portable executable" that windows uses...
[I'm being pedantic here, of course, since everyone knows that in ps2dev parlance, "an .elf file" is generally taken to mean "A staticly-linked MIPS-5900 little-endian executable ELF file."]
Thanks oopo, and mharris for being so imformative.
I just have one last question :?
Does anybody have any "single-line" code that I could use to test an .elf file on a ps2? This code be anything; it could just draw a block on the screen.
For example:
int main(void)
{
//insert single code function here!
}
Thanks everybody. :wink:
I just have one last question :?
Does anybody have any "single-line" code that I could use to test an .elf file on a ps2? This code be anything; it could just draw a block on the screen.
For example:
int main(void)
{
//insert single code function here!
}
Thanks everybody. :wink:
Damn It. I keep on forgetting to log in! Sorry that is my post directly above.
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)
There is no "hello world" for the PS2...
IMHO, your best bet would be to get one of dreamtime's (and others') tutorials. All you need are the .elf files ;-P but the sources are worth looking at too, as they can show you a lot of the basics of PS2 development. dreamtime uses his own 2D graphics packages (rather than some of the libraries which have become available since he made the tuts); this can be good and bad -- it will help you understand the nuts and bolts of the GS and GIF, but the barrier to entry is pretty high (i.e., you'd have to some work if you wanted to add 3D, backface culling, etc.)
Any of the entries at thethirdcreation.net competitions would be something else to try -- they'll give you a good idea of what people are doing now, but the code is far more complicated in most cases.
IMHO, your best bet would be to get one of dreamtime's (and others') tutorials. All you need are the .elf files ;-P but the sources are worth looking at too, as they can show you a lot of the basics of PS2 development. dreamtime uses his own 2D graphics packages (rather than some of the libraries which have become available since he made the tuts); this can be good and bad -- it will help you understand the nuts and bolts of the GS and GIF, but the barrier to entry is pretty high (i.e., you'd have to some work if you wanted to add 3D, backface culling, etc.)
Any of the entries at thethirdcreation.net competitions would be something else to try -- they'll give you a good idea of what people are doing now, but the code is far more complicated in most cases.
Spot on mrbrown! :D
I found the Hello world sample, albeit I can't get it to compile using the makefile.
Please consider the following question as an extension of my last question, making this question, the very last silly question that I've asked.
How do you make the hello world sample using the makefile and make.exe?
I've got this far:
make -f "c:\ps2dev\ps2lib\ee\samples\hello\makefile" all
then I get this error:
MAKE: *** No rule to make target `hello.o', needed by `hello.elf'. Stop.
My hello world makefile looks like this:
EE_BIN = hello.elf
EE_OBJS = hello.o
all: $(EE_BIN)
clean:
ee-gcc -o *.elf *.c
include C:\ps2dev\ps2lib\ee\samples\hello\Makefile.pref
include C:\ps2dev\ps2lib\ee\samples\hello\Makefile.eeglobal
Thanks guys!
I found the Hello world sample, albeit I can't get it to compile using the makefile.
Please consider the following question as an extension of my last question, making this question, the very last silly question that I've asked.
How do you make the hello world sample using the makefile and make.exe?
I've got this far:
make -f "c:\ps2dev\ps2lib\ee\samples\hello\makefile" all
then I get this error:
MAKE: *** No rule to make target `hello.o', needed by `hello.elf'. Stop.
My hello world makefile looks like this:
EE_BIN = hello.elf
EE_OBJS = hello.o
all: $(EE_BIN)
clean:
ee-gcc -o *.elf *.c
include C:\ps2dev\ps2lib\ee\samples\hello\Makefile.pref
include C:\ps2dev\ps2lib\ee\samples\hello\Makefile.eeglobal
Thanks guys!
Sorry I forgot to login (again). That is my post above.
I must remember to execute the following code each time I use this forum:
unit32 DumbAssUser0xFF = 0x00001000;
TCHAR mental_note = "REMEMBER TO LOGIN!";
DMATransfer(DumbAssUser0xFF, mental_note); :wink:
I must remember to execute the following code each time I use this forum:
unit32 DumbAssUser0xFF = 0x00001000;
TCHAR mental_note = "REMEMBER TO LOGIN!";
DMATransfer(DumbAssUser0xFF, mental_note); :wink:
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)
Change to the "hello" directory instead of making it from the very outside of the building tree.
And for the forum, when you login, you have the little nifty checkbox "Remember me".
And for the forum, when you login, you have the little nifty checkbox "Remember me".
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Thanks pixel, but there are still some errors when I run make.exe from the same directory as the hello sample.
When I compile it from the "hello" directory, I get this:
C:\ps2dev\ps2lib\ee\samples\hello>make
ee-gcc -D_EE -fshort-double -O2 -G0 -c -Wall -Ic:/ps2dev/PS2LIB/ee/include -Ic:/
ps2dev/PS2LIB/common/include -I. hello.c -o hello.o
MAKE: ee-gcc: Command not found
MAKE: *** [hello.o] Error 127
The hello makefile looks like this:
EE_BIN = hello.elf
EE_OBJS = hello.o
all: $(EE_BIN)
clean:
rm -f *.elf *.o *.a
include ..\..\..\Makefile.pref
include ..\..\..\Makefile.eeglobal
I'm stumped for answers, please help.
When I compile it from the "hello" directory, I get this:
C:\ps2dev\ps2lib\ee\samples\hello>make
ee-gcc -D_EE -fshort-double -O2 -G0 -c -Wall -Ic:/ps2dev/PS2LIB/ee/include -Ic:/
ps2dev/PS2LIB/common/include -I. hello.c -o hello.o
MAKE: ee-gcc: Command not found
MAKE: *** [hello.o] Error 127
The hello makefile looks like this:
EE_BIN = hello.elf
EE_OBJS = hello.o
all: $(EE_BIN)
clean:
rm -f *.elf *.o *.a
include ..\..\..\Makefile.pref
include ..\..\..\Makefile.eeglobal
I'm stumped for answers, please help.
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)
Your environment (read, the PATH variable) is not correct. Set it so it includes the path to your ee-gcc.exe file.
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Thanks a MILLION pixel for sticking with me.
I finally got the sample working (and appened to an infinite loop so I could see "Hello World" on the screen)
I owe you one.
If you need any favours, I'll be glad to help. :D
I finally got the sample working (and appened to an infinite loop so I could see "Hello World" on the screen)
I owe you one.
If you need any favours, I'll be glad to help. :D
my business site: http://www.codebytesdev.dynip.com
(brand spanking new)
(brand spanking new)