diff options
Diffstat (limited to 'backends/platform/psp/Makefile')
-rw-r--r-- | backends/platform/psp/Makefile | 167 |
1 files changed, 111 insertions, 56 deletions
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile index 9d9f863444..d0ba3de85a 100644 --- a/backends/platform/psp/Makefile +++ b/backends/platform/psp/Makefile @@ -2,84 +2,132 @@ # $URL$ # $Id$ -ENABLED=STATIC_PLUGIN - -#control build -DISABLE_SCALERS = true -DISABLE_HQ_SCALERS = true +VERBOSE_BUILD=1 +#Use only this section to modify how the makefile behaves ------------ +# Scummvm engine config: choose which engines are enabled ENABLE_SCUMM = $(ENABLED) ENABLE_SCUMM_7_8 = $(ENABLED) -#ENABLE_HE = $(ENABLED) +ENABLE_HE = $(ENABLED) ENABLE_AGI = $(ENABLED) ENABLE_AGOS = $(ENABLED) -#ENABLE_CINE = $(ENABLED) -#ENABLE_CRUISE = $(ENABLED) +ENABLE_CINE = $(ENABLED) +ENABLE_CRUISE = $(ENABLED) ENABLE_DRASCULA = $(ENABLED) ENABLE_GOB = $(ENABLED) -#ENABLE_IGOR = $(ENABLED) +ENABLE_IGOR = $(ENABLED) ENABLE_KYRA = $(ENABLED) ENABLE_LURE = $(ENABLED) -#ENABLE_M4 = $(ENABLED) -#ENABLE_MADE = $(ENABLED) -#ENABLE_PARALLACTION = $(ENABLED) -#ENABLE_QUEEN = $(ENABLED) -#ENABLE_SAGA = $(ENABLED) +ENABLE_M4 = $(ENABLED) +ENABLE_MADE = $(ENABLED) +ENABLE_PARALLACTION = $(ENABLED) +ENABLE_QUEEN = $(ENABLED) +ENABLE_SAGA = $(ENABLED) ENABLE_SKY = $(ENABLED) ENABLE_SWORD1 = $(ENABLED) ENABLE_SWORD2 = $(ENABLED) -#ENABLE_TINSEL = $(ENABLED) -#ENABLE_TOUCHE = $(ENABLED) - - +ENABLE_TINSEL = $(ENABLED) +ENABLE_TOUCHE = $(ENABLED) +ENABLE_SCI = $(ENABLED) +ENABLE_IHNM = $(ENABLED) + +#Set to 1 to enable, 0 to disable dynamic modules +DYNAMIC_MODULES = 1 +#Set to 1 to enable, 0 to disable libmad and libogg +USE_LIBMAD = 1 +USE_LIBOGG = 1 +#Set to 1 to enable, 0 to disable gcc optimizations +GCC_OPTIMIZE = 0 +# -------------------------------------------------------------------- + + +# General variables srcdir = ../../.. VPATH = $(srcdir) -HAVE_GCC3 = false - -PSPSDK=$(shell psp-config --pspsdk-path) +TARGET = scummvm-psp +# PSP SDK location variables +PSPSDK := $(shell psp-config --pspsdk-path) PSPBIN = $(PSPSDK)/../bin -LDFLAGS = -CXX = psp-g++ -AS = psp-gcc -LD = psp-gcc -AR = psp-ar cru -RANLIB = psp-ranlib -STRIP = psp-strip +#check PSPSDK presence +ifeq ($(PSPSDK),) +$(error $$(PSPSDK) cannot be obtained.) +endif + + +# Variables for common Scummvm makefile +#CC = psp-gcc +CXX = psp-g++ +CXXFLAGS = -O3 -Wall -Wno-multichar -fno-exceptions -fno-rtti +DEFINES = -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB +LDFLAGS := +INCDIR := $(srcdir) . $(srcdir)/engines/ $(PSPSDK)/include +INCLUDES := $(addprefix -I, $(INCDIR)) +#EXECUTABLE = $(TARGET) +DEPDIR = .deps +MODULE_DIRS += ./ MKDIR = mkdir -p RM = rm -f RM_REC = rm -rf -MKSFO = mksfoex -d MEMSIZE=1 -PACK_PBP = pack-pbp -FIXUP = psp-fixup-imports +AR = psp-ar cru +RANLIB = psp-ranlib +AS = psp-gcc +LD = psp-gcc +HAVE_GCC3 = true +CXX_UPDATE_DEP_FLAG = -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP -#check PSPSDK presence -ifeq ($(PSPSDK),) -$(error $$(PSPSDK) is undefined. Use "PSPSDK := $$(shell psp-config --pspsdk-path)" in your Makefile) -endif +# Variables for dynamic plugin building +PLUGIN_PREFIX = +PLUGIN_SUFFIX = .plg +PLUGIN_EXTRA_DEPS = plugin.syms scummvm-psp.elf +# ,--retain-symbols-file,plugin.syms +PLUGIN_LDFLAGS = -nostartfiles -Wl,-q,--just-symbols=scummvm-psp.org.elf,-Tplugin.ld \ + -lstdc++ -lc -Wl,-Map,mapfile.txt -# Add in PSPSDK includes and libraries. -INCDIR := $(srcdir) . $(srcdir)/engines/ . $(PSPSDK)/include -LIBDIR := $(LIBDIR) . $(PSPSDK)/lib +#PLUGIN_EXTRA_DEPS = plugin.ld plugin.syms scummvm-psp.elf +#PLUGIN_LDFLAGS = -Wl -Tplugin.ld --just-symbols=scummvm-psp.org.elf --retain-symbols-file plugin.syms -CXXFLAGS = -O3 -Wall -D__PSP__ -DNONSTANDARD_PORT -DDISABLE_TEXT_CONSOLE -DDISABLE_COMMAND_LINE -DUSE_ZLIB -DDISABLE_DOSBOX_OPL -Wno-multichar `$(PSPBIN)/sdl-config --cflags` -CXXFLAGS:= $(addprefix -I,$(INCDIR)) $(CXXFLAGS) -LDFLAGS := $(addprefix -L,$(LIBDIR)) $(LDFLAGS) -LIBS = +# Remove unneeded scalers +DISABLE_SCALERS = true +DISABLE_HQ_SCALERS = true -#comment this out if you don't want to use libmad -CXXFLAGS+= -DUSE_MAD -LIBS += -lmad +# PSP-specific variables +STRIP = psp-strip +MKSFO = mksfoex -d MEMSIZE=1 +PACK_PBP = pack-pbp +FIXUP = psp-fixup-imports -#comment this out if you don't want to use libtremor -CXXFLAGS+= -DUSE_VORBIS -DUSE_TREMOR +# Test for adding different libs +ifeq ($(USE_LIBMAD),1) +DEFINES += -DUSE_MAD +LIBS += -lmad +endif +ifeq ($(USE_LIBOGG), 1) +DEFINES += -DUSE_VORBIS -DUSE_TREMOR LIBS += -lvorbisidec +endif -LIBS += `$(PSPBIN)/sdl-config --libs` -lz -lstdc++ -lc -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet -lpspnet_inet -lpsputility -lpspuser -lpsppower +# Test for dynamic plugins +ifeq ($(DYNAMIC_MODULES),1) +ENABLED = DYNAMIC_PLUGIN +DEFINES += -DDYNAMIC_MODULES +PRE_OBJS_FLAGS = -Wl,--whole-archive +POST_OBJS_FLAGS = -Wl,--no-whole-archive +else +ENABLED = STATIC_PLUGIN +endif -CXXFLAGS := $(CXXFLAGS) -fno-exceptions -fno-rtti +# SDL Libs and Flags +SDLFLAGS := $(shell $(PSPBIN)/sdl-config --cflags) +SDLLIBS := $(shell $(PSPBIN)/sdl-config --libs) +# PSP LIBS +PSPLIBS = -lpspdisplay -lpspgu -lpspctrl -lpspsdk -lpspnet \ + -lpspnet_inet -lpsputility -lpspuser -lpsppower + +# Add in PSPSDK includes and libraries. +CXXFLAGS += $(SDLFLAGS) +LIBS += -lz -lstdc++ -lc $(SDLLIBS) $(PSPLIBS) -TARGET = scummvm-psp OBJS := powerman.o \ psp_main.o \ osys_psp.o \ @@ -87,13 +135,13 @@ OBJS := powerman.o \ kbd_s_c.o \ kbd_ls_c.o \ kbd_l_c.o \ - trace.o - -DEPDIR = .deps -CXX_UPDATE_DEP_FLAG = "-Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP" + trace.o \ + psploader.o +# Include common Scummvm makefile include $(srcdir)/Makefile.common +# Variables for PSP-specific rules PSP_EBOOT_SFO = param.sfo PSP_EBOOT_TITLE = ScummVM-PSP PSP_EBOOT = EBOOT.PBP @@ -104,10 +152,17 @@ PSP_EBOOT_PIC1 = pic1.png PSP_EBOOT_SND0 = NULL PSP_EBOOT_PSAR = NULL +SCOBJS := $(filter %.o, $(OBJS)) +SCARCS := $(filter %.a, $(OBJS)) +SCBE := $(filter %backends.a, $(SCARCS)) +LDFLAGS += -Wl,-Tmain_prog.ld + all: $(PSP_EBOOT) +# --start-group $^ --end-group $(TARGET).elf: $(OBJS) - $(LD) $^ $(LIBS) -o $@ + $(LD) $(PRE_OBJS_FLAGS) $(OBJS) $(POST_OBJS_FLAGS) $(LDFLAGS) $(LIBS) -o $@ + cp $(TARGET).elf $(TARGET).org.elf $(FIXUP) $@ $(PSP_EBOOT_SFO): @@ -134,4 +189,4 @@ SCEkxploit: $(TARGET).elf $(PSP_EBOOT_SFO) $(PACK_PBP) "%__SCE__$(TARGET)/$(PSP_EBOOT)" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \ $(PSP_EBOOT_ICON1) $(PSP_EBOOT_PIC0) $(PSP_EBOOT_PIC1) \ $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR) - + |