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
36 ifeq ($(platform), unix)
37 TARGET := $(TARGET_NAME)_libretro.so
39 DONT_COMPILE_IN_ZLIB = 1
40 else ifeq ($(platform), osx)
41 TARGET := $(TARGET_NAME)_libretro.dylib
46 ifeq ($(shell uname -p),powerpc)
51 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
53 OSXVER = `sw_vers -productVersion | cut -c 4`
55 SHARED += -mmacosx-version-min=10.5
57 else ifeq ($(platform), ios)
58 TARGET := $(TARGET_NAME)_libretro_ios.dylib
62 CC = clang -arch armv7 -isysroot $(IOSSDK)
63 CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
64 CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
65 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
66 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
68 OSXVER = `sw_vers -productVersion | cut -c 4`
70 CC += -miphoneos-version-min=5.0
71 CXX += -miphoneos-version-min=5.0
72 CC_AS += -miphoneos-version-min=5.0
73 CFLAGS += -miphoneos-version-min=5.0
85 else ifeq ($(platform), ps3)
86 TARGET := $(TARGET_NAME)_libretro_ps3.a
87 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
88 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
89 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
92 DONT_COMPILE_IN_ZLIB = 1
105 else ifeq ($(platform), sncps3)
106 TARGET := $(TARGET_NAME)_libretro_ps3.a
107 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
108 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
109 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
112 DONT_COMPILE_IN_ZLIB = 1
125 else ifeq ($(platform), psl1ght)
126 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
127 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
128 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
129 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__ -DFAMEC_NO_GOTOS
132 DONT_COMPILE_IN_ZLIB = 1
145 else ifeq ($(platform), psp1)
146 TARGET := $(TARGET_NAME)_libretro_psp1.a
147 CC = psp-gcc$(EXE_EXT)
148 AR = psp-ar$(EXE_EXT)
152 DONT_COMPILE_IN_ZLIB = 1
165 else ifeq ($(platform), xenon)
166 TARGET := $(TARGET_NAME)_libretro_xenon360.a
167 CC = xenon-gcc$(EXE_EXT)
168 AR = xenon-ar$(EXE_EXT)
169 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
170 else ifeq ($(platform), ngc)
171 TARGET := $(TARGET_NAME)_libretro_ngc.a
172 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
173 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
174 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
175 else ifeq ($(platform), wii)
176 TARGET := libretro_$(TARGET_NAME)_wii.a
177 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
178 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
179 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
180 else ifeq ($(platform), qnx)
181 TARGET := $(TARGET_NAME)_libretro_qnx.so
182 CC = qcc -Vgcc_ntoarmv7le
184 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
185 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
189 else ifneq (,$(findstring armv,$(platform)))
190 TARGET := $(TARGET_NAME)_libretro.so
191 SHARED := -shared -Wl,--no-undefined
192 ifneq (,$(findstring cortexa8,$(platform)))
193 CFLAGS += -marm -mcpu=cortex-a8
194 ASFLAGS += -mcpu=cortex-a8
195 else ifneq (,$(findstring cortexa9,$(platform)))
196 CFLAGS += -marm -mcpu=cortex-a9
197 ASFLAGS += -mcpu=cortex-a9
200 ifneq (,$(findstring neon,$(platform)))
202 ASFLAGS += -mfpu=neon
204 ifneq (,$(findstring softfloat,$(platform)))
205 CFLAGS += -mfloat-abi=softfp
206 ASFLAGS += -mfloat-abi=softfp
207 else ifneq (,$(findstring hardfloat,$(platform)))
208 CFLAGS += -mfloat-abi=hard
209 ASFLAGS += -mfloat-abi=hard
211 ifneq (,$(findstring armasm,$(platform)))
216 TARGET := $(TARGET_NAME)_libretro.dll
219 SHARED := -shared -static-libgcc -static-libstdc++
220 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
240 ifeq ($(findstring Haiku,$(shell uname -a)),)