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 > Makefile

#49206 - NighTiger - Wed Jul 27, 2005 9:03 am

Hi guys,
I use the devkitPro.
I did try to make a correct Makefile but without success.

Where I can find a correct Makefile?
tnx

#49218 - QuantumDoja - Wed Jul 27, 2005 11:29 am

Hi, try something like this.....

put this text in a "Make.bat" file.

Change the "path" to where the bin folder of devkit resides.

Code:

REM Description: This is my batch file
path=C:\DEVKIT\devkitadv\bin
gcc -c -O3 -mthumb -mthumb-interwork main.c
gcc -mthumb -mthumb-interwork -o Main.elf main.o
objcopy -O binary Main.elf Main.gba
pause

_________________
Chris Davis

#49220 - NighTiger - Wed Jul 27, 2005 12:15 pm

tnx, but I use linux

#49221 - NoMis - Wed Jul 27, 2005 12:26 pm

You should download the Makefile Tutorial from MrMr[iCE] at the gbadev.org Tutorial section. It's a pretty good starting point to learn makefiles. I used it myself to get the knowlege.

You might also want to take a look at the GNU make documentation.

NoMis
_________________
www.gamedev.at - The austrian gamedev site
hde.gamedev.at - The Handheld Dev Env plugins for Eclipse

#49226 - strager - Wed Jul 27, 2005 2:21 pm

DevKitPro has examples. Find the system you are looking for (GBA, GP32...) and have a look at the examples' Makefile. Notice that they are all the same (for each system, anyways), because the Makefiles automatically generates a list of files to compile and link. I find this very helpful, and you should too. :)

#49227 - NighTiger - Wed Jul 27, 2005 2:23 pm

Where are the examples? 8-)

#49247 - zazery - Wed Jul 27, 2005 7:47 pm

They are located in the devkitPro CVS. See the last step on this page.