1 # Makefile for PicoDrive (libretro)
5 ifeq ($(shell uname -a),)
7 else ifneq ($(findstring MINGW,$(shell uname -a)),)
9 else ifneq ($(findstring Darwin,$(shell uname -a)),)
12 ifeq ($(shell uname -p),powerpc)
15 else ifneq ($(findstring win,$(shell uname -a)),)
26 TARGET_NAME := picodrive
38 ifeq ($(platform), unix)
39 TARGET := $(TARGET_NAME)_libretro.so
41 DONT_COMPILE_IN_ZLIB = 1
42 CFLAGS += -DFAMEC_NO_GOTOS
45 else ifeq ($(platform), linux-portable)
46 TARGET := $(TARGET_NAME)_libretro.so
47 SHARED := -shared -nostdlib
49 DONT_COMPILE_IN_ZLIB = 1
50 CFLAGS += -DFAMEC_NO_GOTOS
53 else ifeq ($(platform), osx)
54 TARGET := $(TARGET_NAME)_libretro.dylib
58 ifeq ($(shell uname -p),powerpc)
62 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
64 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
65 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
66 ifeq ($(OSX_LT_MAVERICKS),"YES")
67 SHARED += -mmacosx-version-min=10.5
71 else ifeq ($(platform), ios)
72 TARGET := $(TARGET_NAME)_libretro_ios.dylib
76 IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
78 CC = clang -arch armv7 -isysroot $(IOSSDK)
79 CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
80 CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
81 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
82 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
84 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
85 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
86 ifeq ($(OSX_LT_MAVERICKS),"YES")
87 CC += -miphoneos-version-min=5.0
88 CXX += -miphoneos-version-min=5.0
89 CC_AS += -miphoneos-version-min=5.0
90 CFLAGS += -miphoneos-version-min=5.0
102 else ifeq ($(platform), ps3)
103 TARGET := $(TARGET_NAME)_libretro_ps3.a
104 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
105 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
106 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
109 DONT_COMPILE_IN_ZLIB = 1
124 else ifeq ($(platform), sncps3)
125 TARGET := $(TARGET_NAME)_libretro_ps3.a
126 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
127 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
128 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
131 DONT_COMPILE_IN_ZLIB = 1
145 # Lightweight PS3 Homebrew SDK
146 else ifeq ($(platform), psl1ght)
147 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
148 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
149 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
150 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
153 DONT_COMPILE_IN_ZLIB = 1
168 else ifeq ($(platform), psp1)
169 TARGET := $(TARGET_NAME)_libretro_psp1.a
170 CC = psp-gcc$(EXE_EXT)
171 AR = psp-ar$(EXE_EXT)
175 DONT_COMPILE_IN_ZLIB = 1
190 else ifeq ($(platform), xenon)
191 TARGET := $(TARGET_NAME)_libretro_xenon360.a
192 CC = xenon-gcc$(EXE_EXT)
193 AR = xenon-ar$(EXE_EXT)
194 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
197 else ifeq ($(platform), ngc)
198 TARGET := $(TARGET_NAME)_libretro_ngc.a
199 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
200 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
201 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
204 else ifeq ($(platform), wii)
205 TARGET := libretro_$(TARGET_NAME)_wii.a
206 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
207 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
208 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
211 else ifeq ($(platform), qnx)
212 TARGET := $(TARGET_NAME)_libretro_qnx.so
213 CC = qcc -Vgcc_ntoarmv7le
215 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
216 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
221 else ifneq (,$(findstring armv,$(platform)))
222 TARGET := $(TARGET_NAME)_libretro.so
223 SHARED := -shared -Wl,--no-undefined
224 ifneq (,$(findstring cortexa5,$(platform)))
225 CFLAGS += -marm -mcpu=cortex-a5
226 ASFLAGS += -mcpu=cortex-a5
227 else ifneq (,$(findstring cortexa8,$(platform)))
228 CFLAGS += -marm -mcpu=cortex-a8
229 ASFLAGS += -mcpu=cortex-a8
230 else ifneq (,$(findstring cortexa9,$(platform)))
231 CFLAGS += -marm -mcpu=cortex-a9
232 ASFLAGS += -mcpu=cortex-a9
233 else ifneq (,$(findstring cortexa15a7,$(platform)))
234 CFLAGS += -marm -mcpu=cortex-a15.cortex-a7
235 ASFLAGS += -mcpu=cortex-a15.cortex-a7
239 ifneq (,$(findstring neon,$(platform)))
241 ASFLAGS += -mfpu=neon
243 ifneq (,$(findstring softfloat,$(platform)))
244 CFLAGS += -mfloat-abi=softfp
245 ASFLAGS += -mfloat-abi=softfp
246 else ifneq (,$(findstring hardfloat,$(platform)))
247 CFLAGS += -mfloat-abi=hard
248 ASFLAGS += -mfloat-abi=hard
250 ifneq (,$(findstring armasm,$(platform)))
257 TARGET := $(TARGET_NAME)_libretro.dll
260 SHARED := -shared -static-libgcc -static-libstdc++
261 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
282 ifeq ($(findstring Haiku,$(shell uname -a)),)