2011-11-30 00:33:14 +00:00
|
|
|
###
|
|
|
|
##
|
|
|
|
# Makefile for SSNES. Somewhat generic and avoids using the odd SDK examples.
|
|
|
|
##
|
|
|
|
###
|
|
|
|
##
|
2011-11-30 00:41:50 +00:00
|
|
|
DEBUG=0
|
2011-11-30 17:26:42 +00:00
|
|
|
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)
|
|
|
|
CC = $(CELL_SDK)/sn/ps3ppusnc
|
|
|
|
CXX = $(CC)
|
|
|
|
LD = $(CELL_SDK)/sn/ps3ppuld
|
|
|
|
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
|
|
|
|
2011-12-02 00:38:04 +00:00
|
|
|
OBJ = ps3/buffer.o ps3/ps3_audio.o ps3/resampler.o ps3/ps3_input.o ps3/pad_input.o getopt.o ssnes.o driver.o file.o settings.o message.o rewind.o movie.o gfx/gfx_common.o ps3/ps3_video_psgl.o gfx/shader_cg.o gfx/snes_state.o ups.o bps.o strl.o screenshot.o audio/hermite.o dynamic.o ps3/main.o audio/utils.o
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2011-12-02 00:28:47 +00:00
|
|
|
LIBS = -ldbgfont -lPSGL -lgcm_cmd -lgcm_sys_stub -lsnes -lresc_stub -lm -lio_stub -lfs_stub -lsysutil_stub -lsysmodule_stub -laudio_stub -lnet_stub -lpthread
|
2011-11-30 00:33:14 +00:00
|
|
|
|
2011-12-02 00:28:47 +00:00
|
|
|
DEFINES = -DHAVE_OPENGL=1 -DHAVE_CG=1 -DHAVE_FBO=1 -D__CELLOS_LV2__ -DPACKAGE_VERSION=\"0.9.2\" -Dmain=ssnes_main -mno-sn-ld
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
# Wrap it up, son!
|
|
|
|
#LIBS += -Wl,-wrap,fopen -Wl,-wrap,fclose -Wl,-wrap,fwrite -Wl,-wrap,fread -Wl,-wrap,fseek -Wl,-wrap,ftell -Wl,-wrap,fflush -Wl,-wrap,rewind -Wl,-wrap,fgetpos -Wl,-wrap,fsetpos -Wl,-wrap,setbuf -Wl,-wrap,setvbuf -Wl,-wrap,ungetc -Wl,-wrap,feof
|
2011-11-30 00:41:50 +00:00
|
|
|
ifeq ($(DEBUG),1)
|
|
|
|
PPU_OPTIMIZE_LV := -O0 -g
|
|
|
|
else
|
|
|
|
PPU_OPTIMIZE_LV := -O3
|
|
|
|
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 17:26:42 +00:00
|
|
|
#CFLAGS = -Wall $(PPU_OPTIMIZE_LV) -std=gnu99 -DPS3_SDK_3_41 -DSSNES_DEBUG
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
#CFLAGS += -fprofile-generate --coverage -g
|
|
|
|
#CXXFLAGS += -fprofile-generate --coverage -g
|
|
|
|
#LDFLAGS += -fprofile-generate --coverage -g
|
|
|
|
#CFLAGS += -pg -g
|
|
|
|
#CXXFLAGS += -pg -g
|
|
|
|
#LDFLAGS += -pg -g -lprof_stub
|
|
|
|
#CFLAGS += -fprofile-use
|
|
|
|
#CXXFLAGS += -fprofile-use
|
|
|
|
#LDFLAGS += -fprofile-use
|
|
|
|
|
2011-11-30 17:26:42 +00:00
|
|
|
#CFLAGS = -Wall $(PPU_OPTIMIZE_LV) -std=gnu99
|
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)
|
2011-12-02 00:28:47 +00:00
|
|
|
$(MAKE_FSELF_NPDRM) $(PPU_TARGET) ps3/pkg/USRDIR/EBOOT.BIN
|
|
|
|
$(MAKE_PACKAGE_NPDRM) ps3/pkg/package.conf pkg
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f *.o
|
|
|
|
rm -f hqflt/*.o
|
|
|
|
rm -f hqflt/snes_ntsc/*.o
|
|
|
|
rm -f $(PPU_TARGET)
|
|
|
|
rm -f *.pkg
|
2011-12-02 00:28:47 +00:00
|
|
|
rm -rf ps3/*.o
|
2011-11-30 00:33:14 +00:00
|
|
|
|
|
|
|
.PHONY: all clean pkg
|
|
|
|
|
|
|
|
|