2011-11-30 00:33:14 +00:00
|
|
|
###
|
|
|
|
##
|
2011-12-04 16:19:21 +00:00
|
|
|
# Makefile for SSNES PS3. Somewhat generic and avoids using the odd SDK examples.
|
2011-11-30 00:33:14 +00:00
|
|
|
##
|
|
|
|
###
|
|
|
|
##
|
2011-12-04 16:19:21 +00:00
|
|
|
DEBUG = 0
|
|
|
|
CELL_BUILD_TOOLS = GCC
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
## Platform detection from nall/Makefile. Only two applicable hosts for PS3 SDK.
|
|
|
|
ifeq ($(platform),)
|
|
|
|
uname := $(shell uname -a)
|
|
|
|
ifeq ($(uname),)
|
|
|
|
platform := win
|
|
|
|
else
|
|
|
|
platform := linux
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
CELL_SDK := /usr/local/cell
|
|
|
|
ifeq ($(platform),win)
|
|
|
|
HOST_DIR := host-win32
|
|
|
|
else
|
|
|
|
HOST_DIR := host-linux
|
|
|
|
endif
|
|
|
|
|
2011-11-30 17:26:42 +00:00
|
|
|
ifeq ($(CELL_BUILD_TOOLS),SNC)
|
2012-01-11 21:55:07 +00:00
|
|
|
CC = $(CELL_SDK)/$(HOST_DIR)/sn/bin/ps3ppusnc
|
2011-11-30 17:26:42 +00:00
|
|
|
CXX = $(CC)
|
2012-01-11 21:55:07 +00:00
|
|
|
LD = $(CELL_SDK)/$(HOST_DIR)/sn/bin/ps3ppuld
|
2011-11-30 17:26:42 +00:00
|
|
|
else
|
2011-11-30 00:33:14 +00:00
|
|
|
CC = $(CELL_SDK)/$(HOST_DIR)/ppu/bin/ppu-lv2-gcc
|
|
|
|
CXX = $(CELL_SDK)/$(HOST_DIR)/ppu/bin/ppu-lv2-g++
|
|
|
|
LD = $(CELL_SDK)/$(HOST_DIR)/ppu/bin/ppu-lv2-g++
|
2011-11-30 17:26:42 +00:00
|
|
|
endif
|
|
|
|
STRIP = $(CELL_SDK)/$(HOST_DIR)/ppu/bin/ppu-lv2-strip
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
PPU_TARGET := ssnes.elf
|
|
|
|
|
|
|
|
LDDIRS = -L. -L$(CELL_SDK)/target/ppu/lib/PSGL/RSX/ultra-opt
|
|
|
|
INCDIRS = -I. -Icommon
|
|
|
|
|
2011-11-30 17:26:42 +00:00
|
|
|
MAKE_FSELF_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_fself_npdrm
|
|
|
|
MAKE_PACKAGE_NPDRM = $(CELL_SDK)/$(HOST_DIR)/bin/make_package_npdrm
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2012-01-26 02:00:56 +00:00
|
|
|
OBJ = fifo_buffer.o ps3/cellframework2/fileio/file_browser.o ps3/ps3_audio.o ps3/menu.o console/rom_ext.o ps3/ps3_input.o ps3/cellframework2/input/pad_input.o getopt.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o netplay.o netplay_compat.o gfx/gfx_common.o ps3/ps3_video_psgl.o gfx/shader_cg.o gfx/snes_state.o ups.o bps.o strl.o audio/hermite.o dynamic.o ps3/main.o audio/utils.o conf/config_file.o ps3/image.o
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2012-01-17 23:59:35 +00:00
|
|
|
LIBS = -ldbgfont -lPSGL -lPSGLcgc -lcgc -lgcm_cmd -lgcm_sys_stub -lsnes -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysutil_game_stub -lsysutil_screenshot_stub -lpngdec_stub -ljpgdec_stub -lsysmodule_stub -laudio_stub -lnet_stub -lpthread
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2012-01-26 02:00:56 +00:00
|
|
|
DEFINES = -DSSNES_CONSOLE -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DHAVE_CONFIGFILE=1 -DHAVE_NETPLAY=1 -DHAVE_SOCKET_LEGACY=1 -DPACKAGE_VERSION=\"0.9.4.1\" -DHAVE_SCREENSHOTS_BUILTIN=1 -Dmain=ssnes_main
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2011-12-04 16:19:21 +00:00
|
|
|
ifeq ($(DEBUG), 1)
|
2011-11-30 00:41:50 +00:00
|
|
|
PPU_OPTIMIZE_LV := -O0 -g
|
|
|
|
else
|
2012-01-11 21:27:07 +00:00
|
|
|
PPU_OPTIMIZE_LV := -O3 -g
|
2011-11-30 00:41:50 +00:00
|
|
|
endif
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
## Use this for new SDK!
|
2011-11-30 00:41:50 +00:00
|
|
|
CFLAGS = $(PPU_OPTIMIZE_LV) $(DEFINES)
|
|
|
|
CXXFLAGS = $(PPU_OPTIMIZE_LV) $(DEFINES)
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
all: pkg
|
|
|
|
|
|
|
|
$(PPU_TARGET): $(OBJ)
|
|
|
|
$(LD) -o $@ $(OBJ) $(LDFLAGS) $(LDDIRS) $(LIBS)
|
|
|
|
$(STRIP) $(PPU_TARGET)
|
|
|
|
|
2011-12-02 00:59:07 +00:00
|
|
|
%.o: %.c config.h
|
2011-11-30 00:33:14 +00:00
|
|
|
$(CC) $(INCDIRS) $(CFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
%.o: %.cpp config.h
|
|
|
|
$(CXX) $(INCDIRS) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
pkg: $(PPU_TARGET)
|
2012-01-11 00:17:04 +00:00
|
|
|
cp ssnes.cfg ps3/pkg/USRDIR/
|
2012-01-28 12:23:25 +00:00
|
|
|
git submodule init
|
|
|
|
git submodule update
|
2012-01-27 22:35:38 +00:00
|
|
|
cp ps3/override/border-only.cg ps3/pkg/USRDIR/shaders/Borders/Menu/
|
2011-12-02 00:28:47 +00:00
|
|
|
$(MAKE_FSELF_NPDRM) $(PPU_TARGET) ps3/pkg/USRDIR/EBOOT.BIN
|
2011-12-02 01:07:46 +00:00
|
|
|
$(MAKE_PACKAGE_NPDRM) ps3/pkg/package.conf ps3/pkg
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(PPU_TARGET)
|
2011-12-02 23:49:09 +00:00
|
|
|
rm -f $(OBJ)
|
2011-11-30 00:33:14 +00:00
|
|
|
rm -f *.pkg
|
|
|
|
|
|
|
|
.PHONY: all clean pkg
|
|
|
|
|