forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiling ticpp for psp

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Tue Mar 09, 2010 7:54 am    Post subject: Compiling ticpp for psp Reply with quote

Hi!

I would like to develop a PC-PSP portable game using basically C++ and SDL. The thing is that I'm also interested on a very useful library called ticpp which helps in parsing XML files. Obviously it compiles normally as static library for Linux or Windows but I can't write a proper makefile for PSP. I supose I have to change the compiler macro and a few things more but I just can't.

I hope someone here have more experiencing in writting correct makefiles for psp.

Ticpp official site: http://code.google.com/p/ticpp/
Building instructions for Linux and Windows: http://code.google.com/p/ticpp/wiki/BuildInstructions

Thank you very much!
Back to top
View user's profile Send private message
psPea



Joined: 01 Sep 2007
Posts: 64

PostPosted: Tue Mar 09, 2010 2:24 pm    Post subject: Reply with quote

I tried a generic makefile and it compiled
Code:
TARGET_LIB = ticpp.a
OBJS = ticpp.o \
       tinystr.o \
       tinyxml.o \
       tinyxmlerror.o \
       tinyxmlparser.o

INCDIR =
CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS = -lstdc++


PSPDIR=$(shell psp-config --psp-prefix)
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

_________________
Click ME!
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Tue Mar 09, 2010 9:28 pm    Post subject: Reply with quote

Thanks, it compiled but now I have another problem: how can I write a makefile of a program which uses ticpp.a? How can I link the static library in a psp makefile?

Could someone help me please, I'm kind of a newbie with makefiles in general and psp ones in particular.

Thanks again.
Back to top
View user's profile Send private message
NoEffex



Joined: 27 Nov 2008
Posts: 108

PostPosted: Wed Mar 10, 2010 12:08 pm    Post subject: Reply with quote

sionlord wrote:
Thanks, it compiled but now I have another problem: how can I write a makefile of a program which uses ticpp.a? How can I link the static library in a psp makefile?

Could someone help me please, I'm kind of a newbie with makefiles in general and psp ones in particular.

Thanks again.


CFLAGS += -L./folder_with_ticpp.a
LIBS += -lticpp.a

Something like that. If it doesn't work, rename ticpp.a to libticpp.a, and possibly remove .a.
_________________
Programming with:
Geany + Latest PSPSDK from svn
Back to top
View user's profile Send private message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Wed Mar 10, 2010 5:14 pm    Post subject: Reply with quote

A normal makefile for a SDL game and ticpp would look like:

Code:
# Rutas
MOTOR_DIR := .

# Ejecutable del juego.
EXE := sdltest
EXEWIN := airforcepilotwin.exe

# Ficheros fuente del juego (modificar para añadir) .
SRC := main.cpp

# Ficheros fuente del motor.
SRC_MOTOR :=
      
      
# motor_dir + fuentes
SRC_DIR_MOTOR := $(foreach src, $(SRC_MOTOR),$(MOTOR_DIR)/$(src) )

# Objetos
OBJS := $(SRC:%.cpp=%.o)
OBJS_MOTOR := $(SRC_DIR_MOTOR:%.cpp=%.o)

# Compilador y las opciones
CXX = c++
CXXFLAGS = -pedantic -Wall -pipe -ggdb -D"TIXML_USE_TICPP" -I$(MOTOR_DIR)
LDFLAGS = -L$(MOTOR_DIR)/ticpp -lticpp -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf -ggdb
LDWINFLAGS = -L$(MOTOR_DIR)/ticpp -lticppwin -lmingw32 -lSDLmain -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf

# Config para make
all: $(EXE)
win32: $(EXEWIN)

# Obtención del ejecutable
$(EXE): $(OBJS) $(OBJS_MOTOR)
   $(CXX) -o $@ $^ $(LDFLAGS)

$(EXEWIN): $(OBJS) $(OBJS_MOTOR)
   $(CXX) -o $@ $^ $(LDWINFLAGS)


# Limpieza
clean:
    $(RM) $(EXE) $(OBJS) $(OBJS_MOTOR) *~ -rf

clean-win32:
   del $(EXEWIN) *.o .\motor\*.o *~


While my psp makefile looks like:

Code:
TARGET = Sdl_Example
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
OBJS =  main.o

DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)

MORE_CFLAGS = -G0 -O2 -DPSP

CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) -D"TIXML_USE_TICPP" -I$(MOTOR_DIR)
CXXFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) -fno-exceptions -fno-rtti

LIBS = -lSDL_gfx -lSDL_image -lSDL_mixer -lSDL_ttf -lvorbisidec \
   -lfreetype -lpng -ljpeg -lz -lm $(shell $(SDL_CONFIG) --libs) -L$(MOTOR_DIR)/ticpp -lticpp

EXTRA_TARGETS = EBOOT.PBP

include $(PSPSDK)/lib/build.mak


There is a ticpp.a file inside a ticpp folder compiled for the proper platform.

Still isn't working, hope you could help me having now this info.

Thanks again.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Mar 11, 2010 3:04 am    Post subject: Reply with quote

As he said,
Quote:
If it doesn't work, rename ticpp.a to libticpp.a
Back to top
View user's profile Send private message
sionlord



Joined: 09 Mar 2010
Posts: 10

PostPosted: Thu Mar 11, 2010 9:38 am    Post subject: Reply with quote

I've tried that and it doesn't seem to link properly mmm anyone has the clue?
Back to top
View user's profile Send private message
psPea



Joined: 01 Sep 2007
Posts: 64

PostPosted: Thu Mar 11, 2010 10:27 am    Post subject: Reply with quote

you didn't really define MOTOR_DIR did you

also it would be much easier to find problems with a compile log
_________________
Click ME!
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group