I Just Want To Dev For The Gp2x!


dabomb3627

Still Fresh
Joined
Jan 12, 2008
Messages
75
Location
Nashville TN
Website
Visit site
I need very simple step by step instructions on how to set up a simple gp2x IDE on 64 bit ubuntu 7.04. I already have the open2x toolchain and required libraries set up, but thats as far as i got. and also, could somebody walk me through the whole make process? while i know c++, i was taught on the crutch that is Borland's automatic compiler; no makefiles.
 
Use this Makefile. Change OPEN2X for your system, OBJS to list your object files (.o filenames that match your .c files), TARGET to the name of your application and add in LIBS the static libraries that you use. The example is for basic SDL libs.

CODE

TARGET=myapp.gpe
OBJS=objectfile1.o objectfile2.o objectfile3.o # match objectfile1.c, objectfile2.c and objectfile3.c

OPEN2X = /opt/open2x/gcc-4.1.1-glibc-2.3.6

CC = $(OPEN2X)/bin/arm-open2x-linux-gcc
LD = $(CC)
STRIP = $(OPEN2X)/bin/arm-open2x-linux-strip

CFLAGS_SDL=`$(OPEN2X)/bin/sdl-config --cflags`
LIBS_SDL=`$(OPEN2X)/bin/sdl-config --static-libs`

CFLAGS = -Wall -DGP2X -Werror -I$(OPEN2X)/include $(CFLAGS_SDL)
LDFLAGS=-static -L$(OPEN2X)/lib
LIBS=$(LIBS_SDL)

$(TARGET): $(OBJS)
$(LD) $(LDFLAGS) $(OBJS) -o $@ $(LIBS)
$(STRIP) $@

clean:
rm -f *.o *~



Take into account that the indentation of the last lines is with tabs and only tabs.

Then you can use any develop environment for your source files. I like Kate or Kdevelop for the KDE environment, or even vim from command line. Then place this Makefile in the same directory that your source files object1.c, object2.c and object3.c and run 'make'.
 
what do i name the makefile? other than that, i think i get what you're saying. thanks

EDIT: also is there any sort of gp2x environtment or way i can test the app using only gp2x specifications such as the 200MHz clock and the 64MB RAM?
 
Linkous said:
what do i name the makefile?
'Makefile' First letter upper case :)

QUOTE
is there any sort of gp2x environtment or way i can test the app using only gp2x specifications such as the 200MHz clock and the 64MB RAM?


If you use standard libreries such as SDL you can compile and run for your PC, and only compile for the Gp2x when you are sure that the application works. In this case use two different makefiles ('Makefile' and 'Makefile.gp2x'), one for the Gp2x (the previous one) and another pretty similar for the PC. Look for any introductory tutorial to write the Makefiles, they are really easy to set up.
 
Last edited by a moderator:
yes yes i know i can compile for the pc (linux box actually) but is there any way i could run said program in an environment similar to the gp2x on my computer? because god know a 2GB RAM 3.8 GHz box is going to be able to run anything made for the gp2x, but how do i limit the app's so that i can see how the app would run on the small 200MHz handheld?
 
Linkous said:
what do i name the makefile? other than that, i think i get what you're saying. thanks

EDIT: also is there any sort of gp2x environtment or way i can test the app using only gp2x specifications such as the 200MHz clock and the 64MB RAM?

Name it anything you want, but if it's not Makefile you'll need to launch as `make -f anyname`
 
Last edited by a moderator:
As fas as I know, there is not any virtual machine or emulator of the Gp2x on a PC. You have to test applications on a real Gp2x to check their performance. Fortunately, you can easily use a F100 Gp2x as a developer box throught USB. Telnet+SMB are the perfect tools for this task (see the Wiki). The F200 is a bit more difficult to connect to a PC and then is a bit more difficult to be used as a test machine, you'll need the cradle or an EXT->USB adapter to get the same that the F100 offers.

Of course, you can always perform performance tests by copying and running your app from a SD card :)
 
Back
Top