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
37 ifeq ($(platform), unix)
38 TARGET := $(TARGET_NAME)_libretro.so
40 DONT_COMPILE_IN_ZLIB = 1
41 CFLAGS += -DFAMEC_NO_GOTOS
42 else ifeq ($(platform), linux-portable)
43 TARGET := $(TARGET_NAME)_libretro.so
44 SHARED := -shared -nostdlib
46 DONT_COMPILE_IN_ZLIB = 1
47 CFLAGS += -DFAMEC_NO_GOTOS
48 else ifeq ($(platform), osx)
49 TARGET := $(TARGET_NAME)_libretro.dylib
54 ifeq ($(shell uname -p),powerpc)
59 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
61 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
62 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
63 ifeq ($(OSX_LT_MAVERICKS),"YES")
64 SHARED += -mmacosx-version-min=10.5
66 else ifeq ($(platform), ios)
67 TARGET := $(TARGET_NAME)_libretro_ios.dylib
72 IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
75 CC = clang -arch armv7 -isysroot $(IOSSDK)
76 CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
77 CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
78 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
79 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
81 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
82 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
83 ifeq ($(OSX_LT_MAVERICKS),"YES")
84 CC += -miphoneos-version-min=5.0
85 CXX += -miphoneos-version-min=5.0
86 CC_AS += -miphoneos-version-min=5.0
87 CFLAGS += -miphoneos-version-min=5.0
99 else ifeq ($(platform), ps3)
100 TARGET := $(TARGET_NAME)_libretro_ps3.a
101 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
102 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
103 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
106 DONT_COMPILE_IN_ZLIB = 1
119 else ifeq ($(platform), sncps3)
120 TARGET := $(TARGET_NAME)_libretro_ps3.a
121 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
122 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
123 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
126 DONT_COMPILE_IN_ZLIB = 1
139 else ifeq ($(platform), psl1ght)
140 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
141 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
142 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
143 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
146 DONT_COMPILE_IN_ZLIB = 1
159 else ifeq ($(platform), psp1)
160 TARGET := $(TARGET_NAME)_libretro_psp1.a
161 CC = psp-gcc$(EXE_EXT)
162 AR = psp-ar$(EXE_EXT)
166 DONT_COMPILE_IN_ZLIB = 1
179 else ifeq ($(platform), xenon)
180 TARGET := $(TARGET_NAME)_libretro_xenon360.a
181 CC = xenon-gcc$(EXE_EXT)
182 AR = xenon-ar$(EXE_EXT)
183 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
184 else ifeq ($(platform), ngc)
185 TARGET := $(TARGET_NAME)_libretro_ngc.a
186 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
187 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
188 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
189 else ifeq ($(platform), wii)
190 TARGET := libretro_$(TARGET_NAME)_wii.a
191 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
192 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
193 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
194 else ifeq ($(platform), qnx)
195 TARGET := $(TARGET_NAME)_libretro_qnx.so
196 CC = qcc -Vgcc_ntoarmv7le
198 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
199 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
203 else ifneq (,$(findstring armv,$(platform)))
204 TARGET := $(TARGET_NAME)_libretro.so
205 SHARED := -shared -Wl,--no-undefined
206 ifneq (,$(findstring cortexa8,$(platform)))
207 CFLAGS += -marm -mcpu=cortex-a8
208 ASFLAGS += -mcpu=cortex-a8
209 else ifneq (,$(findstring cortexa9,$(platform)))
210 CFLAGS += -marm -mcpu=cortex-a9
211 ASFLAGS += -mcpu=cortex-a9
214 ifneq (,$(findstring neon,$(platform)))
216 ASFLAGS += -mfpu=neon
218 ifneq (,$(findstring softfloat,$(platform)))
219 CFLAGS += -mfloat-abi=softfp
220 ASFLAGS += -mfloat-abi=softfp
221 else ifneq (,$(findstring hardfloat,$(platform)))
222 CFLAGS += -mfloat-abi=hard
223 ASFLAGS += -mfloat-abi=hard
225 ifneq (,$(findstring armasm,$(platform)))
230 TARGET := $(TARGET_NAME)_libretro.dll
233 SHARED := -shared -static-libgcc -static-libstdc++
234 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
254 ifeq ($(findstring Haiku,$(shell uname -a)),)