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 

PDCurses SDL

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



Joined: 26 May 2009
Posts: 6
Location: The fourth dimension

PostPosted: Thu Nov 19, 2009 7:06 am    Post subject: PDCurses SDL Reply with quote

I have done some research and now know that PDCurses can be built for the PSP with SDL. I've been trying to build the library for this purpose, and I'm tinkering with the Makefile to try to get it to work right. I've gotten this far:

Code:
# Makefile for PDCurses library for SDL

O = o

ifndef PDCURSES_SRCDIR
        PDCURSES_SRCDIR = ..
endif

include $(PDCURSES_SRCDIR)/libobjs.mif

osdir           = $(PDCURSES_SRCDIR)/sdl1

PDCURSES_SDL_H  = $(osdir)/pdcsdl.h

PSPBIN = $(PSPSDK)/../bin
SFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
SLIBS += $(shell $(PSPBIN)/sdl-config --libs)

# If your system doesn't have these, remove the defines here
SFLAGS          += -DHAVE_VSNPRINTF -DHAVE_VSSCANF

ifeq ($(DEBUG),Y)
        CFLAGS  = -g -Wall -DPDCDEBUG
else
        CFLAGS  = -O2 -Wall
endif

BUILD           = $(CC) $(CFLAGS) -I$(PDCURSES_SRCDIR)

ifeq ($(shell uname),Darwin)
        DEMOFLAGS = -Dmain=SDL_main
endif

LINK            = $(CC)
LDFLAGS         = $(LIBCURSES) $(SLIBS)
RANLIB          = ranlib
LIBCURSES       = libpdcurses.a

DEMOS           = firework newdemo ptest rain testcurs tuidemo worm xmas \
sdltest

.PHONY: all libs clean demos

all:    libs

libs:   $(LIBCURSES)

clean:
        -rm -rf *.o trace $(LIBCURSES) $(DEMOS)

demos:  $(DEMOS)
        strip $(DEMOS)

$(LIBCURSES) : $(LIBOBJS) $(PDCOBJS)
        ar rv $@ $?
        -$(RANLIB) $@

$(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
$(PDCOBJS) : $(PDCURSES_SDL_H)
$(DEMOS) : $(PDCURSES_CURSES_H) $(LIBCURSES)
tui.o tuidemo.o : $(PDCURSES_CURSES_H)
terminfo.o: $(TERM_HEADER)
panel.o ptest: $(PANEL_HEADER)

$(LIBOBJS) : %.o: $(srcdir)/%.c
        $(BUILD) $(SFLAGS) -c $<

$(PDCOBJS) : %.o: $(osdir)/%.c
        $(BUILD) $(SFLAGS) -c $<

firework: $(demodir)/firework.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

newdemo: $(demodir)/newdemo.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

ptest: $(demodir)/ptest.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

rain: $(demodir)/rain.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

testcurs: $(demodir)/testcurs.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

tuidemo: tuidemo.o tui.o
        $(LINK) tui.o tuidemo.o -o $@ $(LDFLAGS)

worm: $(demodir)/worm.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

xmas: $(demodir)/xmas.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

sdltest: $(osdir)/sdltest.c
        $(BUILD) $(DEMOFLAGS) -o $@ $< $(LDFLAGS)

tui.o: $(demodir)/tui.c $(demodir)/tui.h
        $(BUILD) -c $(DEMOFLAGS) $(demodir)/tui.c

tuidemo.o: $(demodir)/tuidemo.c
        $(BUILD) -c $(DEMOFLAGS) $(demodir)/tuidemo.c


Now I'm trying to make it build the library with the PSP compiler instead of my system's cc. Unfortunately, I've gotten confused. Could someone please help?
_________________
Beware the Ratfink, he can gnaw through your Ethernet cable!
Back to top
View user's profile Send private message
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