1 # Makefile for PCSX ReARMed (libretro)
5 ifeq ($(shell uname -a),)
7 else ifneq ($(findstring MINGW,$(shell uname -a)),)
9 else ifneq ($(findstring Darwin,$(shell uname -a)),)
11 else ifneq ($(findstring win,$(shell uname -a)),)
22 TARGET_NAME := pcsx_rearmed
27 ifeq ($(platform), unix)
28 TARGET := $(TARGET_NAME)_libretro.so
30 SHARED := -shared -Wl,--version-script=libretro/link.T
33 else ifeq ($(platform), osx)
34 TARGET := $(TARGET_NAME)_libretro.dylib
37 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
38 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
39 ifeq ($(OSX_LT_MAVERICKS),"YES")
40 fpic += -mmacosx-version-min=10.5
44 else ifeq ($(platform), ios)
46 TARGET := $(TARGET_NAME)_libretro_ios.dylib
51 IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
54 CC = clang -arch armv7 -isysroot $(IOSSDK)
55 CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
56 CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
57 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
58 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
63 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
64 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
65 ifeq ($(OSX_LT_MAVERICKS),"YES")
66 CC += -miphoneos-version-min=5.0
67 CXX += -miphoneos-version-min=5.0
68 CC_AS += -miphoneos-version-min=5.0
69 CFLAGS += -miphoneos-version-min=5.0
73 else ifeq ($(platform), ps3)
74 TARGET := $(TARGET_NAME)_libretro_ps3.a
75 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
76 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
77 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
80 else ifeq ($(platform), sncps3)
81 TARGET := $(TARGET_NAME)_libretro_ps3.a
82 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
83 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
84 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
86 # Lightweight PS3 Homebrew SDK
87 else ifeq ($(platform), psl1ght)
88 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
89 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
90 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
91 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
94 else ifeq ($(platform), psp1)
95 TARGET := $(TARGET_NAME)_libretro_psp1.a
96 CC = psp-gcc$(EXE_EXT)
101 else ifeq ($(platform), xenon)
102 TARGET := $(TARGET_NAME)_libretro_xenon360.a
103 CC = xenon-gcc$(EXE_EXT)
104 AR = xenon-ar$(EXE_EXT)
105 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
108 else ifeq ($(platform), ngc)
109 TARGET := $(TARGET_NAME)_libretro_ngc.a
110 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
111 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
112 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
115 else ifeq ($(platform), wii)
116 TARGET := libretro_$(TARGET_NAME)_wii.a
117 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
118 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
119 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
122 else ifeq ($(platform), qnx)
123 TARGET := $(TARGET_NAME)_libretro_qnx.so
124 CC = qcc -Vgcc_ntoarmv7le
131 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
132 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
135 else ifneq (,$(findstring armv,$(platform)))
136 TARGET := $(TARGET_NAME)_libretro.so
137 SHARED := -shared -Wl,--no-undefined
139 ifneq (,$(findstring cortexa8,$(platform)))
140 CFLAGS += -marm -mcpu=cortex-a8
141 ASFLAGS += -mcpu=cortex-a8
142 else ifneq (,$(findstring cortexa9,$(platform)))
143 CFLAGS += -marm -mcpu=cortex-a9
144 ASFLAGS += -mcpu=cortex-a9
147 ifneq (,$(findstring neon,$(platform)))
149 ASFLAGS += -mfpu=neon
153 ifneq (,$(findstring softfloat,$(platform)))
154 CFLAGS += -mfloat-abi=softfp
155 ASFLAGS += -mfloat-abi=softfp
156 else ifneq (,$(findstring hardfloat,$(platform)))
157 CFLAGS += -mfloat-abi=hard
158 ASFLAGS += -mfloat-abi=hard
165 TARGET := $(TARGET_NAME)_libretro.dll
169 SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=libretro/link.T
170 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
175 ifneq ($(platform),qnx)
179 MAIN_LDFLAGS += -shared
180 MAIN_LDLIBS += -lm -lz
183 TARGET ?= libretro.so
186 SOUND_DRIVERS = libretro
192 # no special AS needed for gpu_neon
193 plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o: plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
194 $(CC) $(CFLAGS) -c $^ -o $@