Genesis-Plus-GX/Makefile.libretro

308 lines
9.3 KiB
Makefile
Raw Normal View History

2012-07-09 21:14:35 +00:00
DEBUG = 0
2012-07-10 17:15:26 +00:00
LOGSOUND = 0
FRONTEND_SUPPORTS_RGB565 = 1
2012-07-09 21:14:35 +00:00
GENPLUS_SRC_DIR := core
TREMOR_SRC_DIR := $(GENPLUS_SRC_DIR)/tremor
2012-07-09 21:14:35 +00:00
LIBRETRO_DIR := libretro
2013-09-15 21:10:42 +00:00
ifneq ($(EMSCRIPTEN),)
platform = emscripten
endif
2012-07-09 21:14:35 +00:00
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
2014-04-14 03:47:00 +00:00
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
2012-07-09 21:14:35 +00:00
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
2014-04-14 03:47:00 +00:00
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
2013-04-17 16:34:21 +00:00
TARGET_NAME := genesis_plus_gx
2012-07-09 21:14:35 +00:00
ifeq ($(platform), unix)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro.so
2012-07-09 21:14:35 +00:00
fpic := -fPIC
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2012-07-09 21:14:35 +00:00
PLATFORM_DEFINES := -DHAVE_ZLIB
else ifeq ($(platform), osx)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro.dylib
2014-04-14 03:47:00 +00:00
fpic := -fPIC
2012-07-09 21:14:35 +00:00
SHARED := -dynamiclib -lz
ifeq ($(arch),ppc)
2014-07-18 15:35:40 +00:00
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
else
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2014-04-14 03:47:00 +00:00
endif
2012-07-09 21:14:35 +00:00
PLATFORM_DEFINES := -DHAVE_ZLIB
OSXVER = `sw_vers -productVersion | cut -c 4`
ifneq ($(OSXVER),9)
fpic += -mmacosx-version-min=10.5
endif
2013-03-17 22:51:57 +00:00
else ifeq ($(platform), ios)
2013-05-18 01:46:19 +00:00
TARGET := $(TARGET_NAME)_libretro_ios.dylib
2013-03-17 22:51:57 +00:00
fpic := -fPIC
SHARED := -dynamiclib -lz
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
PLATFORM_DEFINES := -DHAVE_ZLIB
2013-03-17 22:51:57 +00:00
CC = clang -arch armv7 -isysroot $(IOSSDK)
OSXVER = `sw_vers -productVersion | cut -c 4`
ifneq ($(OSXVER),9)
CC += -miphoneos-version-min=5.0
PLATFORM_DEFINES += -miphoneos-version-min=5.0
endif
else ifeq ($(platform), qnx)
2013-04-30 13:54:26 +00:00
TARGET := $(TARGET_NAME)_libretro_qnx.so
fpic := -fPIC
2013-04-07 22:28:25 +00:00
SHARED := -lm -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
PLATFORM_DEFINES := -DHAVE_ZLIB
CC = qcc -Vgcc_ntoarmv7le
AR = qcc -Vgcc_ntoarmv7le
PLATFORM_DEFINES := -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
2012-07-09 21:14:35 +00:00
else ifeq ($(platform), ps3)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_ps3.a
2012-07-09 21:14:35 +00:00
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
2014-07-18 15:35:40 +00:00
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
else ifeq ($(platform), sncps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
2014-07-18 15:35:40 +00:00
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER -DBYTE_ORDER=BIG_ENDIAN
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2012-07-09 21:14:35 +00:00
else ifeq ($(platform), psl1ght)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_psl1ght.a$(EXE_EXT)
CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
PLATFORM_DEFINES := -D__CELLOS_LV2 -DALT_RENDER
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2012-11-23 19:51:59 +00:00
else ifeq ($(platform), psp1)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_psp1.a$(EXE_EXT)
2012-11-23 19:51:59 +00:00
CC = psp-gcc$(EXE_EXT)
AR = psp-ar$(EXE_EXT)
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2012-11-23 19:51:59 +00:00
PLATFORM_DEFINES := -DPSP
2012-11-24 03:34:19 +00:00
CFLAGS += -G0
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2012-07-09 21:14:35 +00:00
else ifeq ($(platform), xenon)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_xenon360.a
CC = xenon-gcc$(EXE_EXT)
AR = xenon-ar$(EXE_EXT)
2012-07-09 21:14:35 +00:00
PLATFORM_DEFINES := -D__LIBXENON__ -DALT_RENDER
2014-07-18 15:35:40 +00:00
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2012-09-01 01:12:03 +00:00
else ifeq ($(platform), ngc)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_ngc.a
2012-09-01 01:12:03 +00:00
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
2014-07-18 15:35:40 +00:00
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
2012-09-01 01:12:03 +00:00
PLATFORM_DEFINES := -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2012-07-09 21:14:35 +00:00
else ifeq ($(platform), wii)
2013-04-17 16:34:21 +00:00
TARGET := $(TARGET_NAME)_libretro_wii.a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
2012-09-01 01:12:03 +00:00
PLATFORM_DEFINES := -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DALT_RENDER
2014-07-18 15:35:40 +00:00
ENDIANNESS_DEFINES := -DBYTE_ORDER=BIG_ENDIAN
2013-05-18 15:49:57 +00:00
STATIC_LINKING = 1
2013-07-14 00:31:53 +00:00
else ifneq (,$(findstring armv,$(platform)))
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2013-07-14 00:31:53 +00:00
PLATFORM_DEFINES := -DHAVE_ZLIB
CC = gcc
ifneq (,$(findstring cortexa8,$(platform)))
PLATFORM_DEFINES += -marm -mcpu=cortex-a8
else ifneq (,$(findstring cortexa9,$(platform)))
PLATFORM_DEFINES += -marm -mcpu=cortex-a9
endif
PLATFORM_DEFINES += -marm
ifneq (,$(findstring neon,$(platform)))
PLATFORM_DEFINES += -mfpu=neon
HAVE_NEON = 1
endif
ifneq (,$(findstring softfloat,$(platform)))
PLATFORM_DEFINES += -mfloat-abi=softfp
else ifneq (,$(findstring hardfloat,$(platform)))
PLATFORM_DEFINES += -mfloat-abi=hard
endif
PLATFORM_DEFINES += -DARM
2013-09-15 21:10:42 +00:00
else ifeq ($(platform), emscripten)
TARGET := $(TARGET_NAME)_libretro_emscripten.bc
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2012-07-09 21:14:35 +00:00
else
2013-05-18 15:49:57 +00:00
TARGET := $(TARGET_NAME)_libretro.dll
2012-07-09 21:14:35 +00:00
CC = gcc
SHARED := -shared -static-libgcc -static-libstdc++ -Wl,--version-script=libretro/link.T -Wl,--no-undefined -lz
ENDIANNESS_DEFINES := -DLSB_FIRST -DBYTE_ORDER=LITTLE_ENDIAN
2012-07-09 21:14:35 +00:00
PLATFORM_DEFINES := -DHAVE_ZLIB
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
2013-09-15 21:10:42 +00:00
else ifeq ($(platform),qnx)
CFLAGS += -Os -DNDEBUG
2013-09-15 21:10:42 +00:00
else ifeq ($(platform), emscripten)
CFLAGS += -O2 -DNDEBUG
else
CFLAGS += -O3 -DNDEBUG
endif
2012-07-09 21:14:35 +00:00
LIBRETRO_SRC := $(GENPLUS_SRC_DIR)/genesis.c \
$(GENPLUS_SRC_DIR)/vdp_ctrl.c \
$(GENPLUS_SRC_DIR)/vdp_render.c \
$(GENPLUS_SRC_DIR)/system.c \
$(GENPLUS_SRC_DIR)/io_ctrl.c \
$(GENPLUS_SRC_DIR)/loadrom.c \
$(GENPLUS_SRC_DIR)/mem68k.c \
$(GENPLUS_SRC_DIR)/state.c \
$(GENPLUS_SRC_DIR)/memz80.c \
$(GENPLUS_SRC_DIR)/membnk.c \
$(GENPLUS_SRC_DIR)/input_hw/activator.c \
$(GENPLUS_SRC_DIR)/input_hw/gamepad.c \
$(GENPLUS_SRC_DIR)/input_hw/input.c \
$(GENPLUS_SRC_DIR)/input_hw/lightgun.c \
$(GENPLUS_SRC_DIR)/input_hw/mouse.c \
$(GENPLUS_SRC_DIR)/input_hw/paddle.c \
$(GENPLUS_SRC_DIR)/input_hw/sportspad.c \
$(GENPLUS_SRC_DIR)/input_hw/teamplayer.c \
$(GENPLUS_SRC_DIR)/input_hw/xe_1ap.c \
2012-07-09 21:14:35 +00:00
$(GENPLUS_SRC_DIR)/input_hw/terebi_oekaki.c \
$(GENPLUS_SRC_DIR)/input_hw/graphic_board.c \
2012-07-09 21:14:35 +00:00
$(GENPLUS_SRC_DIR)/cd_hw/cd_cart.c \
$(GENPLUS_SRC_DIR)/cd_hw/cdc.c \
$(GENPLUS_SRC_DIR)/cd_hw/cdd.c \
$(GENPLUS_SRC_DIR)/cd_hw/gfx.c \
$(GENPLUS_SRC_DIR)/cd_hw/pcm.c \
$(GENPLUS_SRC_DIR)/cd_hw/scd.c \
$(GENPLUS_SRC_DIR)/cart_hw/areplay.c \
$(GENPLUS_SRC_DIR)/cart_hw/md_cart.c \
$(GENPLUS_SRC_DIR)/cart_hw/sms_cart.c \
[Core/SCD] --------------- * added support for CUE files * added CD-DA tracks emulation (needs CUE+BIN or ISO+WAV images) * added CD fader emulation * added CDD "Fast FW" & "Fast RW" commands emulation * improved CDD TOC emulation (random freezes in Sonic CD, Switch/Panic, Final Fight CD and probably many others) * improved PCM chip synchronization with SUB-CPU (missing speeches in Willy Beamish) * fixed PCM chip emulation (random hangs in Snatcher, missing sound effects in Switch/Panic, Final Fight CD, Wonderdog...) * fixed Word-RAM memory mode on soft-reset (missing logo gfx effects) * fixed SUB-CPU access to unused areas when using PC-relative instructions (Final Fight CD first boss random crash) * fixed CPU idle loop detection on memory mode register access (Pugsy CD first boss slowdown) * fixed Mode 1 emulation (cartridge boot mode) [Core/Sound] --------------- * replaced FIR resampler by Blip Buffer for FM resampling * modified SN76489 core for use of Blip Buffer * improved PSG & FM chips synchronization using Blip Buffer * added Game Gear PSG stereo support * fixed SG-1000 specific PSG noise * fixed YM2612 LFO AM waveform (California Games surfing event) * fixed YM2612 phase precision * minor optimizations to YM2612 core [Core/Game Gear] --------------- * added support for CJ Elephant Fugitive (recently released by SMS Power) * added Game Gear extended screen option [Core/Genesis] --------------- * added support for a few recently dumped (but unreleased) games [Core/General] --------------- * improved ROM & CD image file loading * various code cleanup [Gamecube/Wii] --------------- * added automatic disc swap feature * removed automatic frameskipping (no use) * improved general audio/video sync * various code cleanup & bugfixes
2012-10-13 17:01:31 +00:00
$(GENPLUS_SRC_DIR)/cart_hw/eeprom_93c.c \
$(GENPLUS_SRC_DIR)/cart_hw/eeprom_i2c.c \
$(GENPLUS_SRC_DIR)/cart_hw/eeprom_spi.c \
2012-07-09 21:14:35 +00:00
$(GENPLUS_SRC_DIR)/cart_hw/ggenie.c \
$(GENPLUS_SRC_DIR)/cart_hw/sram.c \
$(GENPLUS_SRC_DIR)/cart_hw/svp/ssp16.c \
$(GENPLUS_SRC_DIR)/cart_hw/svp/svp.c \
$(GENPLUS_SRC_DIR)/ntsc/md_ntsc.c \
$(GENPLUS_SRC_DIR)/ntsc/sms_ntsc.c \
2012-10-14 15:10:15 +00:00
$(GENPLUS_SRC_DIR)/sound/eq.c \
2012-07-09 21:14:35 +00:00
$(GENPLUS_SRC_DIR)/sound/sound.c \
$(GENPLUS_SRC_DIR)/sound/ym2612.c \
$(GENPLUS_SRC_DIR)/sound/ym2413.c \
$(GENPLUS_SRC_DIR)/sound/sn76489.c \
[Core/SCD] --------------- * added support for CUE files * added CD-DA tracks emulation (needs CUE+BIN or ISO+WAV images) * added CD fader emulation * added CDD "Fast FW" & "Fast RW" commands emulation * improved CDD TOC emulation (random freezes in Sonic CD, Switch/Panic, Final Fight CD and probably many others) * improved PCM chip synchronization with SUB-CPU (missing speeches in Willy Beamish) * fixed PCM chip emulation (random hangs in Snatcher, missing sound effects in Switch/Panic, Final Fight CD, Wonderdog...) * fixed Word-RAM memory mode on soft-reset (missing logo gfx effects) * fixed SUB-CPU access to unused areas when using PC-relative instructions (Final Fight CD first boss random crash) * fixed CPU idle loop detection on memory mode register access (Pugsy CD first boss slowdown) * fixed Mode 1 emulation (cartridge boot mode) [Core/Sound] --------------- * replaced FIR resampler by Blip Buffer for FM resampling * modified SN76489 core for use of Blip Buffer * improved PSG & FM chips synchronization using Blip Buffer * added Game Gear PSG stereo support * fixed SG-1000 specific PSG noise * fixed YM2612 LFO AM waveform (California Games surfing event) * fixed YM2612 phase precision * minor optimizations to YM2612 core [Core/Game Gear] --------------- * added support for CJ Elephant Fugitive (recently released by SMS Power) * added Game Gear extended screen option [Core/Genesis] --------------- * added support for a few recently dumped (but unreleased) games [Core/General] --------------- * improved ROM & CD image file loading * various code cleanup [Gamecube/Wii] --------------- * added automatic disc swap feature * removed automatic frameskipping (no use) * improved general audio/video sync * various code cleanup & bugfixes
2012-10-13 17:01:31 +00:00
$(GENPLUS_SRC_DIR)/sound/blip_buf.c \
2012-07-09 21:14:35 +00:00
$(GENPLUS_SRC_DIR)/z80/z80.c \
$(GENPLUS_SRC_DIR)/m68k/m68kcpu.c \
$(GENPLUS_SRC_DIR)/m68k/s68kcpu.c \
$(TREMOR_SRC_DIR)/bitwise.c \
$(TREMOR_SRC_DIR)/block.c \
$(TREMOR_SRC_DIR)/codebook.c \
$(TREMOR_SRC_DIR)/floor0.c \
$(TREMOR_SRC_DIR)/floor1.c \
$(TREMOR_SRC_DIR)/framing.c \
$(TREMOR_SRC_DIR)/info.c \
$(TREMOR_SRC_DIR)/mapping0.c \
$(TREMOR_SRC_DIR)/mdct.c \
$(TREMOR_SRC_DIR)/registry.c \
$(TREMOR_SRC_DIR)/res012.c \
$(TREMOR_SRC_DIR)/sharedbook.c \
$(TREMOR_SRC_DIR)/synthesis.c \
$(TREMOR_SRC_DIR)/vorbisfile.c \
$(TREMOR_SRC_DIR)/window.c \
2012-07-09 21:14:35 +00:00
$(LIBRETRO_DIR)/libretro.c
LIBRETRO_OBJ := $(LIBRETRO_SRC:.c=.o)
2012-07-10 17:15:26 +00:00
ifeq ($(LOGSOUND), 1)
LIBRETRO_CFLAGS := -DLOGSOUND
endif
DEFINES := -DUSE_LIBTREMOR
2012-07-09 21:14:35 +00:00
CFLAGS += $(fpic) $(DEFINES) $(CODE_DEFINES)
ifeq ($(FRONTEND_SUPPORTS_RGB565), 1)
# if you have a new frontend that supports RGB565
BPP_DEFINES = -DUSE_16BPP_RENDERING -DFRONTEND_SUPPORTS_RGB565
else
BPP_DEFINES = -DUSE_15BPP_RENDERING
endif
2012-07-10 17:15:26 +00:00
LIBRETRO_CFLAGS += -I$(GENPLUS_SRC_DIR) \
2012-07-09 21:14:35 +00:00
-I$(GENPLUS_SRC_DIR)/sound \
-I$(GENPLUS_SRC_DIR)/input_hw \
-I$(GENPLUS_SRC_DIR)/cart_hw \
-I$(GENPLUS_SRC_DIR)/cd_hw \
-I$(GENPLUS_SRC_DIR)/cart_hw/svp \
-I$(GENPLUS_SRC_DIR)/m68k \
-I$(GENPLUS_SRC_DIR)/z80 \
-I$(GENPLUS_SRC_DIR)/ntsc \
-I$(LIBRETRO_DIR) \
$(BPP_DEFINES) \
2012-07-09 21:14:35 +00:00
$(ENDIANNESS_DEFINES) \
$(PLATFORM_DEFINES) \
-D__LIBRETRO__
2013-04-03 23:59:52 +00:00
ifeq ($(platform), qnx)
LIBRETRO_CFLAGS += -D__inline__=inline
2013-04-03 23:59:52 +00:00
else
LIBRETRO_CFLAGS += -DINLINE="static inline"
endif
2012-07-09 21:14:35 +00:00
LIBRETRO_LIBS := -lm
all: $(TARGET)
%.o: %.c
$(CC) -o $@ -c $< $(CFLAGS) $(LIBRETRO_CFLAGS)
$(TARGET): $(LIBRETRO_OBJ)
2013-05-18 15:49:57 +00:00
ifeq ($(STATIC_LINKING), 1)
2012-07-09 21:14:35 +00:00
$(AR) rcs $@ $(LIBRETRO_OBJ)
else
$(CC) -o $(TARGET) $(fpic) $(LIBRETRO_OBJ) $(LIBRETRO_LIBS) $(SHARED)
endif
2012-08-22 23:37:24 +00:00
clean-objs:
rm -f $(LIBRETRO_OBJ)
2012-07-09 21:14:35 +00:00
clean:
rm -f $(LIBRETRO_OBJ)
rm -f $(TARGET)
2012-08-22 23:37:24 +00:00
.PHONY: clean clean-objs
2012-07-09 21:14:35 +00:00