PDCurses SDL

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Ratfink
Posts: 6
Joined: Tue May 26, 2009 5:15 am
Location: The fourth dimension

PDCurses SDL

Post by Ratfink »

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: Select all

# 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
        $&#40;BUILD&#41; $&#40;SFLAGS&#41; -c $<

$&#40;PDCOBJS&#41; &#58; %.o&#58; $&#40;osdir&#41;/%.c
        $&#40;BUILD&#41; $&#40;SFLAGS&#41; -c $<

firework&#58; $&#40;demodir&#41;/firework.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

newdemo&#58; $&#40;demodir&#41;/newdemo.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

ptest&#58; $&#40;demodir&#41;/ptest.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

rain&#58; $&#40;demodir&#41;/rain.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

testcurs&#58; $&#40;demodir&#41;/testcurs.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

tuidemo&#58; tuidemo.o tui.o
        $&#40;LINK&#41; tui.o tuidemo.o -o $@ $&#40;LDFLAGS&#41;

worm&#58; $&#40;demodir&#41;/worm.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

xmas&#58; $&#40;demodir&#41;/xmas.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

sdltest&#58; $&#40;osdir&#41;/sdltest.c
        $&#40;BUILD&#41; $&#40;DEMOFLAGS&#41; -o $@ $< $&#40;LDFLAGS&#41;

tui.o&#58; $&#40;demodir&#41;/tui.c $&#40;demodir&#41;/tui.h
        $&#40;BUILD&#41; -c $&#40;DEMOFLAGS&#41; $&#40;demodir&#41;/tui.c

tuidemo.o&#58; $&#40;demodir&#41;/tuidemo.c
        $&#40;BUILD&#41; -c $&#40;DEMOFLAGS&#41; $&#40;demodir&#41;/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!
Post Reply