XGCC help?

Hello,

I'm just trying to make my first demo for Genesis. I finally decided to use XGCC. I downloaded some demos written with XGCC, but my problem for now is know how to compile all the stuff.

I've got the compiler, and some other files.

Sega.s and md.l

I also got a demo which has a batch file to compile and link all stuff, a source + included files. But i really can't understand a lot of how it is working....

Where can I find help about this??

Maybe you guys can tell me how to compile, link and include lib files??

Damn, I've been programming for more that 8 years and I now I look like a begginer :)

I understand that you need to compile to object code, doing something like

Code:
gcc Demo.o Demo.c

But there are lots of parameters.

Then I need to link all the stuff...
 
OK,

I'm going to make the following assumtions / directions:

- Your Environment variables are setup.

- XGCC is installed in c:\xgcc\ (the default).

- Your md.l's location is here: c:\xgcc\md.l

- Your program is in its own dir here: c:\xgcc\Demo\

- Your sega.s is here: c:\xgcc\Demo\sega.s

- your program is Demo.c

Make a file called "FILES" with notepad, have it say the following:

Code:
INPUT (sega.o)

INPUT (Demo.o)

Save that to c:\xgcc\Demo\FILES

make make a new file called xmake.bat:

Code:
@echo on

gcc -b 68k -m68000 -O1 -c -o sega.o sega.s

gcc -b 68k -m68000 -O4 -c -o Demo.o Demo.c

gcc -Xlinker -L C:/xgcc/68k/2_8_1/m68000/ -b 68k -T ../md.ld -nostdlib -o Demo. FILES -lm -lc -l135 -lgcc -lg

68k-objc -O binary Demo. Demo.bin

save that to c:\xgcc\Demo\xmake.bat

Now open your command prompt; cd c:\xgcc\Demo; xmake; and you should have your compiler going for that file. Try that as a first step.

Might take a look at some of Fonzie's examples, they have a nice simple structure for compiling (likewise with Kaneda's, they are both very similar and I've modeled mine after them. My make batch file now works just like the regular make executable, with make clean, make smd, make zip, ect). Go here: http://www.genny4ever.net/index.php?page=works and grab his " FVR_WINDOW_TEST" source and try compiling that if you have some troubles.

Good Luck!
 
Thank you

But I wonder what are all those parameters for.

I searched, and found info about some of them.

Code:
gcc -Xlinker -L C:/xgcc/68k/2_8_1/m68000/ -b 68k -T ../md.ld -nostdlib -o Demo. FILES -lm -lc -l135 -lgcc -lg

68k-objc -O binary Demo. Demo.bin

Anyone knows about -lm, -lc, -l135 and -lg ??
 
Back
Top