Having the incredible urge to make a game for the nds, you dont think of the makefile.
You think of your game!
After having sniffed at all sorts of examples you try something of your own, and "Fi Donc!", (french for all kinds of trouble!), the makefile doesn't quite let you taste the sweetness of succes....:-(
What is this monster? This is a file with rules how to link all the things you have put together in your project, and, finally presenting the code, the images, the sounds to the devkitpro, to let it be crunched and digested. All of which has to be done to be able to produce the miracle .nds file, which can be put in the emulators or the nds itself.
Wow!
You can do this by hand too!
http://www.dev-scene.com/NDS/Tutorials_Day_2#Build_A_Demo_The_Hard_Way
the name of this link speaks for itself.
There is some luck around the corner: you are not the first to confront this....
Killroy was here! is written on this wall, and whoever it was, they were good!!!
They have created templates for the makefile.
Want to see a not so template makefile?
Look at this sound example:
http://www.double.co.nz/nintendo_ds/nds_develop4.html
and download and open this makefile, it shows its working very clearly, totally dedicated to this very instructive sound project!
Then go to the devkitpro examples, there you see more generic makefiles, although the methods to work with sprites differ, so, the even the generic makefiles will differ amongst themselves.
in between and writing about the "old" style and the "new" is this link:
http://www.fampennings.nl/maarten/nds/index.htm
here the workings are explained fixing the watch example in de Devkitpro examples in the meantime, and expanding on the two processors ARM7 and ARM9.
Now that you now the why and the how, you can go and talk to these monster makefiles...
what helps to is searching a tutorial on makefile, although this tends to be too general, you can extract some rules and get used to the very short commands....
http://www.opussoftware.com/tutorial/TutMakefile.htm
I use C++ Visual Express for the moment to compile my test projects:
page of devkitpro explaining how to set up:
http://www.devkitpro.org/index.php?s=cpp
(yes, it must be a makefile project)
In the project folder has to be placed the makefile.
In my experience, with projects with a few sprites sounds, and images for backgrounds, the compiler always forgot "something". Cleaning the project didn't help. So i didn't clean anymore, just where the compiler provided errors on images or sounds, i removed these files (all of them .o, .bmp etc of the same name) and generated the project again, this saves compiling time and finally it worked.
Why didn't it work either at once, or not? Computerprogramming is an exact science, no? No comprende! (Spanish for all sorts of trouble!) Maybe my RAM is not sufficient, maybe devkitpro is strange????
later on (in nds traditions never) there will be more on makefiles!!!
this is the offcial description:
http://www.gnu.org/software/make/manual/make.html