GP2X Porting Applcations In General (makefiles)


Pickle

Mega GP Mania
Joined
May 30, 2006
Messages
5,518
Location
Detroit, Michigan
Website
Visit site
These are meant to be very general questions,
Assume you have a applcation and the source code is totally compatible for your platform. In order to port that application does it just require modifying the make files to match the compiler for your platform?

Are all make files created equal, is there one standard? (I know GNU creates make, but does MS follow the same syntax for thier makefiles?)

This started with my curosity of porting an SDL application and it has make files for linux and win32, but how would you make them for the GP2X? Mybe I have a very narrow grasp of what needs to happen, but im ready to learn. I guess I have been relying IDE's to much for my make files.
 
Sometimes you can get away with just modifying the makefiles, but other times you'll need to make tweaks to the code too. Start with the linux makefile and work from there (gp2x is linux so there's no point trying to work from the windows makefile). First thing to do is make sure it's calling the correct versions of gcc etc, then if it still won't compile keep tweaking the bits it's complaining about.
 
woogal posted on Dec 6 2006 at 04:36 PM said:
Sometimes you can get away with just modifying the makefiles, but other times you'll need to make tweaks to the code too. Start with the linux makefile and work from there (gp2x is linux so there's no point trying to work from the windows makefile). First thing to do is make sure it's calling the correct versions of gcc etc, then if it still won't compile keep tweaking the bits it's complaining about.

Would changing the compiler in the makfiles be the biggest change to the makfiles, or is it much more compicated than that? Is the community devkit best suited to assist in this?
 
Last edited by a moderator:
Just to be specific..

Makefiles are relatively standard; the FSF makes a GNU Make which is pretty solid, but they do not define the 'make standrad'; MS has 'nmake' as well, and every compiler vendor out there has a make tool.. they're usually pretty clos,e but always with little differences and extensions :)

gmake has many extensions, so sometimes its work to port to lesser makes.. but gp2x is gmake, so no worries.

It is best to avoid extensions for more compatibility of course.

jeff
 
skeezix posted on Dec 6 2006 at 07:42 PM said:
Just to be specific..

Makefiles are relatively standard; the FSF makes a GNU Make which is pretty solid, but they do not define the 'make standrad'; MS has 'nmake' as well, and every compiler vendor out there has a make tool.. they're usually pretty clos,e but always with little differences and extensions :)

gmake has many extensions, so sometimes its work to port to lesser makes.. but gp2x is gmake, so no worries.

It is best to avoid extensions for more compatibility of course.

jeff

would there be any easy way to tell which version a particular make file should belong to, or do you basically have to ask the original author what they used?
 
Last edited by a moderator:
Pickle posted on Dec 6 2006 at 04:11 PM said:
These are meant to be very general questions,
Assume you have a applcation and the source code is totally compatible for your platform. In order to port that application does it just require modifying the make files to match the compiler for your platform?

Are all make files created equal, is there one standard? (I know GNU creates make, but does MS follow the same syntax for thier makefiles?)

This started with my curosity of porting an SDL application and it has make files for linux and win32, but how would you make them for the GP2X? Mybe I have a very narrow grasp of what needs to happen, but im ready to learn. I guess I have been relying IDE's to much for my make files.


I seem to remember that borlands make was more "accurate" or unix like than microsofts nmake. but borlands doesnt work all that well anymore under the NT derivative command lines (NT, WIN2K, XP). Nmake works just fine. I also live by that keep it simple approach and you can easily move from one to another with little problem. The biggest pain is that gnu make requires tabs on the commands, if your editor converts tabs to spaces and you save without disabling it, you are hosed.

Yes, you can create make files that work on both makes (gnu and ms), the basic syntax is the same between the two.
 
Last edited by a moderator:
well, AFAIK visual studio uses by default the .vcproj file extension and have nmake just to be compatible with the rest of the world, that sucks because only people with visual studio (and perhaps only with the same version as yours or newer) will be able to compile that program

also, makefile are sometimes like shell scripts, and they do have CLI commands that will not run on other platform, if you try to compile squidgesnes on Linux, you'll never going to do it until you rename all files to lowercase (I don't remember if some file is included with uppercase on the source) and "make clean" will not work as make clean from squidgesnes execute a "del *.o", which is an unknown command to Linux, just to name an example, of course...

anyone who take a little bit of care to be non-platform-specific will be able to create a Makefile compatible with both platforms with certain ease
 
Back
Top