gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > DevKit Pro

#79993 - thegamefreak0134 - Tue Apr 18, 2006 12:03 am

To be frank, I'm growing extremely weary of all of you who tell all of the folk here that DevKitAdv is out of date and not any good. As such, before I go off and tell you that it has never given me any problems (which it hasn't) I'd like to go ahead and try the new-fangled thingy.

If I have a folder containing my project and a makefile that I use to compile the project using DevKitAdv, what changes do I need to make to get it working in the new devkit?

Remember that I know very little of compilers, and I live my programming life assumig that they all do a fine job. As long as they work, that is.

Thanks!

-thegamefreak0134
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#79996 - Cearn - Tue Apr 18, 2006 12:23 am

First, you need to add the paths to the bin directories of msys (for make.exe), and of devkitArm (for the actual tool chain). You had to do this for devkitAdv too, so you should know how to do this.

Then devkitARM uses another prefix: instead of (gawd, what was it again) "arm-agb-elf-", you need "arm-elf-". So that's "arm-elf-gcc" and so forth.

Lastly, you need to a '-specs' flag for your linker. "-specs=gba_mb.specs" or "-specs=gba.specs" for multiboot and cart builds, respectively. Oh, and maybe an "-mthumb-interwork" for your compiler and linker flags. But this was recommended procedure anyway.

That's it.

Example (assuming the base dir is e:\dev\):
Code:
// DKAdv steps:
PATH= e:\dev\devkitadvance\tools;e:\dev\devkitadvance\bin;

arm-agb-elf-gcc -mthumb -mthumb-interwork -c first.c
arm-agb-elf-gcc -mthumb -mthumb-interwork first.o -o first.elf
arm-agb-elf-objcopy -O binary first.elf first.gba
# gbafix first.gba # if you have it, doesn't come standard with DKAdv


Code:
// devkitPro steps
PATH= e:\dev\devkitPro\msys\bin;e:\dev\devkitPro\devkitARM\bin;

arm-elf-gcc -mthumb -mthumb-interwork -c first.c
arm-elf-gcc -specs=gba_mb.specs -mthumb -mthumb-interwork first.o -o first.elf
arm-elf-objcopy -O binary first.elf first.gba
gbafix first.gba


Just look at the simularities and differences between both versions, and modify for your current directories and flags.

#80109 - tepples - Tue Apr 18, 2006 9:02 pm

Cearn wrote:
First, you need to add the paths to the bin directories of msys (for make.exe), and of devkitArm (for the actual tool chain). You had to do this for devkitAdv too, so you should know how to do this.

I used my own makefile back in devkitARM R11, but when I upgraded to R16, wintermute told me that using my own makefile was deprecated in favor of using the makefile that comes with devkitARM, in the same way that using my own link script was deprecated when moving from the earliest GBA tools to DevKit Advance. (Is this in fact the case?) Otherwise, your description of the issues is largely accurate, aside from the changes to (unspecified) C semantics in new versions of GCC.

Quote:
Example (assuming the base dir is e:\dev\):

I would recommend against placing anything in a folder called "dev", as it has a special meaning on another platform that programs ported from that platform might assume. I know that at least the C library from DJGPP (PC DOS port of GCC with partial POSIX implementation) has special case handling for C:\dev, D:\dev, etc.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#80166 - thegamefreak0134 - Wed Apr 19, 2006 1:38 pm

OK, now that I'm away from the publib library, here is my makefile: (It' a batch file.)

Code:
path=C:\devkitadv\bin
gcc -o main.elf main.c -lm
objcopy -O binary main.elf smash.bin
tools\gbafix smash.bin -tSSB_ADVANCE
pause


If I understand correctly, do I basically just stick "arm-agb-elf-" in front of the "gcc"? (And likewise with objcopy)

-thegamefreak0134
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#80170 - tepples - Wed Apr 19, 2006 2:09 pm

It was "arm-agb-elf-" under DevKit Advance. Now it's "arm-elf-". Please look in the devkitpro\devkitarm\bin folder to see the correct executable names.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#80181 - thegamefreak0134 - Wed Apr 19, 2006 6:19 pm

I see. (I read the wrong box for the example. Oops.) Thanks a bunch. Once I find this kit, I will try to go ahead and port the project and see how it goes.

-thegamefreak0134
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]