#124725 - beamer30 - Sun Apr 08, 2007 12:16 am
hi i've been going through a number of tuts for awhile now and can't seen to find anything on how to make a makefile.
if someone can teach me or now a tut that teaches it please post here.
#124726 - keldon - Sun Apr 08, 2007 12:21 am
google for makefile tutorial
#124728 - beamer30 - Sun Apr 08, 2007 12:25 am
i have, i got no luck
edit: wait i think i might have found something
edit2: it was a very confusing tut that i couldn't understand(i think it was outdated too)
#124730 - gmiller - Sun Apr 08, 2007 1:11 am
The manual for 'make' http://www.gnu.org/software/make/manual/make.html does a good job of introducing the utility and how it works. From there you need to understand what is needed to build the executable you desire (source files, header files, object files, library files ....). Makefile syntax can be simple or complex based on the problem you are trying to solve.
#124731 - keldon - Sun Apr 08, 2007 1:12 am
you can look at more than one link. i can tell you that the second link in the google search of 'makefile tutorial' (at the present time) yields a good result
#124738 - beamer30 - Sun Apr 08, 2007 2:38 am
of course i'm always looking to read more tuts(knowlage is power) so if anyone has a good link give it to me.
edit: let me clarify this a little though, i want to learn how to make makefiles for the nds and gba not just makefiles in general, and would be very greatful if someone has a tut as i can not find one thank you.
#124739 - Sausage Boy - Sun Apr 08, 2007 3:40 am
Makefiles are just a way to make your computer run certain commands. In order to create a makefile for GBA/NDS, you'll need to know both which commands are necessary, and how to make the makefile run those commands. You can't just learn to make GBA/NDS makefiles, you need to learn how makefiles work, and how compiling for GBA/NDS works.
Or, you can use the makefile in the arm9 template included with the examples in devkitARM. That way, you can focus more on actually programming. When you have programmed for a while, you'll start to understand how your code gets turned into an executable file. Understanding makefiles will be a lot easier when you know that.
_________________
"no offense, but this is the gayest game ever"
#124740 - beamer30 - Sun Apr 08, 2007 3:46 am
thanks i think i'll just use that one but what are the limitations to using this makefile instead of coding my own
#124747 - wintermute - Sun Apr 08, 2007 4:41 am
beamer30 wrote: |
thanks i think i'll just use that one but what are the limitations to using this makefile instead of coding my own |
Personally I'd phrase that question as "What are the limitations of coding my own instead of using this makefile?" but then I wrote the madness that is the devkitPro build system :)
The makefile I provide has been designed to automate as much as possible and avoid the end user having to worry about make too much. This results in two main issues that I felt were tolerable.
1) All source files in the defined source directories will be compiled and linked. This means that files you're no longer using must be removed or renamed. It also means that usng "#include "blah.c" for graphics breaks quite horrendously which, to my mind, is an extremely beneficial side effect.
2) All object files must have a unique name.
The makefile will automatically use g++ to link C++ code and generate dependencies on the fly.
The primary source of information for me when I built this system was http://make.paulandlesley.org/ which may help explain the makefiles in more detail.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#124748 - beamer30 - Sun Apr 08, 2007 4:47 am
ok so its probably the best makefile is what you mean, but i have a question then when yousinf=g that makefile i always get this error
Code: |
C:\devkitPro\Games\framebuffer_demo1>make
arm-eabi-g++ -g -Wall -O2 -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -f
fast-math -mthumb-interwork -I/c/devkitPro/libnds/include -DARM7 -c arm7_main.cp
p -oarm7_main.o
make: arm-eabi-g++: Command not found
make: *** [arm7_main.o] Error 127
C:\devkitPro\Games\framebuffer_demo1>
|
how do i fix
#124751 - tepples - Sun Apr 08, 2007 5:04 am
(Removed misinformation stemming from a misunderstanding of the template, and replaced it with the following, which reflects my new understanding.)
You should have a file "base_rules" somewhere on your hard drive. It might be in a folder whose name is like "C:\devkitPro\devkitARM". The DEVKITARM environment variable should point to this folder, but using MSYS naming convention. For example:
Code: |
DEVKITARM=/c/devkitPro/devkitARM |
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Sun Apr 08, 2007 6:03 pm; edited 1 time in total
#124756 - wintermute - Sun Apr 08, 2007 6:23 am
tepples wrote: |
You should have a file arm-eabi-g++.exe somewhere on your hard drive, such as in the folder "C:\devkitPro\devkitARM\bin". Is this folder in your PATH? |
Please refrain from misinforming people.
This error is generally caused by following the manual installation instructions improperly. It is not recommended that devkitARM\bin be in the PATH.
I usually recommend that people use the installer on windows.
You have either not defined the environment variables or defined them as windows paths.
Code: |
DEVKITPRO = /c/devkitpro
|
not
Code: |
DEVKITPRO = c:\devkitpro
|
and similarly for DEVKITARM
Code: |
DEVKITARM=/c/devkitPro/devkitARM
|
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog
#124763 - keldon - Sun Apr 08, 2007 8:49 am
i gave you some information. second link in the google search. can you follow some damn instructions
http://www.eng.hawaii.edu/Tutor/Make/
here, read that; then ask questions after FFS. A makefile is a makefile whether it is gameboy, dos, or for an alien spaceship.
#124775 - keldon - Sun Apr 08, 2007 3:19 pm
Something about that output looks like command.com and not MinGW32!
#124785 - wintermute - Sun Apr 08, 2007 5:12 pm
Well MinGW32 is a compiler, not a shell. I know what the title bar says but it's somewhat misleading.
It's perfectly possible to run msys make from a command.com/cmd.exe shell and have everything work properly. This even works with cygbloat.
The solution I outline above is always the one that fixes this.
_________________
devkitPro - professional toolchains at amateur prices
devkitPro IRC support
Personal Blog