(iOS) Add min SDK version
[pcsx_rearmed.git] / Makefile.libretro
CommitLineData
706252fc 1# Makefile for PCSX ReARMed (libretro)
2
1c6ab616 3ifeq ($(platform),)
4platform = unix
5ifeq ($(shell uname -a),)
6 platform = win
7else ifneq ($(findstring MINGW,$(shell uname -a)),)
8 platform = win
9else ifneq ($(findstring Darwin,$(shell uname -a)),)
10 platform = osx
11else ifneq ($(findstring win,$(shell uname -a)),)
12 platform = win
13endif
14endif
15
a4874585
C
16CC ?= gcc
17CXX ?= g++
18AS ?= as
8ad07683 19CC_AS ?= $(CC)
b09a1d34 20CFLAGS ?=
1c6ab616 21
de0e733e 22TARGET_NAME := pcsx_rearmed
23
1c6ab616 24ifeq ($(platform), unix)
de0e733e 25 TARGET := $(TARGET_NAME)_libretro.so
1c6ab616 26 fpic := -fPIC
27 SHARED := -shared -Wl,--version-script=libretro/link.T
28else ifeq ($(platform), osx)
de0e733e 29 TARGET := $(TARGET_NAME)_libretro.dylib
1c6ab616 30 fpic := -fPIC
31 SHARED := -dynamiclib
32else ifeq ($(platform), ios)
33ARCH := arm
5cdb2a3c 34 TARGET := $(TARGET_NAME)_libretro_ios.dylib
1c6ab616 35 fpic := -fPIC
36 SHARED := -dynamiclib
37
175daa57 38 CC = clang -arch armv7 -isysroot $(IOSSDK) -miphone-version-min=5.0
39 CXX = clang++ -arch armv7 -isysroot $(IOSSDK) -miphone-version-min=5.0
40 CC_AS = perl ./tools/gas-preprocessor.pl $(CC) -miphone-version-min=5.0
41 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm -miphone-version-min=5.0
9aff1963 42 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
1c6ab616 43 HAVE_NEON = 1
af32009f 44 BUILTIN_GPU = neon
c7b746f0 45 USE_DYNAREC = 1
175daa57 46 CFLAGS += -DIOS -miphoneos-version-min=5.0
1c6ab616 47else ifeq ($(platform), ps3)
c491fa92 48 TARGET := $(TARGET_NAME)_libretro_ps3.a
1c6ab616 49 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
50 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
51 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
52else ifeq ($(platform), sncps3)
c491fa92 53 TARGET := $(TARGET_NAME)_libretro_ps3.a
1c6ab616 54 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
55 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
56 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
57else ifeq ($(platform), psl1ght)
c491fa92 58 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
1c6ab616 59 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
60 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
61 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
62else ifeq ($(platform), psp1)
c491fa92 63 TARGET := $(TARGET_NAME)_libretro_psp1.a
1c6ab616 64 CC = psp-gcc$(EXE_EXT)
65 AR = psp-ar$(EXE_EXT)
66 CFLAGS += -DPSP -G0
67else ifeq ($(platform), xenon)
c491fa92 68 TARGET := $(TARGET_NAME)_libretro_xenon360.a
1c6ab616 69 CC = xenon-gcc$(EXE_EXT)
70 AR = xenon-ar$(EXE_EXT)
71 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
72else ifeq ($(platform), ngc)
c491fa92 73 TARGET := $(TARGET_NAME)_libretro_ngc.a
1c6ab616 74 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
75 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
76 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
77else ifeq ($(platform), wii)
de0e733e 78 TARGET := libretro_$(TARGET_NAME)_wii.a
1c6ab616 79 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
80 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
81 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
a4874585 82else ifeq ($(platform), qnx)
c491fa92 83 TARGET := $(TARGET_NAME)_libretro_qnx.so
3d2350ad 84 CC = qcc -Vgcc_ntoarmv7le
b09a1d34 85 CC_AS = $(CC)
a4874585
C
86 HAVE_NEON = 1
87 USE_DYNAREC = 1
88 DRC_CACHE_BASE = 0
89 BUILTIN_GPU = neon
90 ARCH = arm
3d2350ad 91 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
92 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
5d0bfd31 93else ifneq (,$(findstring armv,$(platform)))
de0e733e 94 TARGET := $(TARGET_NAME)_libretro.so
5d0bfd31 95 SHARED := -shared -Wl,--no-undefined
098fa5f5 96 DRC_CACHE_BASE = 0
5d0bfd31 97ifneq (,$(findstring cortexa8,$(platform)))
98 CFLAGS += -marm -mcpu=cortex-a8
99 ASFLAGS += -mcpu=cortex-a8
100else ifneq (,$(findstring cortexa9,$(platform)))
101 CFLAGS += -marm -mcpu=cortex-a9
102 ASFLAGS += -mcpu=cortex-a9
103endif
104 CFLAGS += -marm
105ifneq (,$(findstring neon,$(platform)))
106 CFLAGS += -mfpu=neon
107 ASFLAGS += -mfpu=neon
108 HAVE_NEON = 1
098fa5f5 109 BUILTIN_GPU = neon
5d0bfd31 110endif
111ifneq (,$(findstring softfloat,$(platform)))
112 CFLAGS += -mfloat-abi=softfp
113 ASFLAGS += -mfloat-abi=softfp
114else ifneq (,$(findstring hardfloat,$(platform)))
115 CFLAGS += -mfloat-abi=hard
116 ASFLAGS += -mfloat-abi=hard
117endif
098fa5f5 118 ARCH = arm
5d0bfd31 119 USE_DYNAREC = 1
1c6ab616 120else
de0e733e 121 TARGET := $(TARGET_NAME)_retro.dll
1c6ab616 122 CC = gcc
123 fpic := -fPIC
124 LD_FLAGS := -fPIC
125 SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=libretro/link.T
126 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
127endif
128
9aff1963 129CFLAGS += -fPIC
a4874585
C
130ifneq ($(platform),qnx)
131 LDLIBS += -lpthread
132 MAIN_LDLIBS += -ldl
133endif
9aff1963 134MAIN_LDFLAGS += -shared
a4874585 135MAIN_LDLIBS += -lm -lz
9aff1963 136EXTRA_LDFLAGS =
706252fc 137
a4874585 138TARGET ?= libretro.so
706252fc 139PLATFORM = libretro
a4874585 140BUILTIN_GPU ?= peops
706252fc 141SOUND_DRIVERS = libretro
9aff1963 142PLUGINS =
143NO_CONFIG_MAK = yes
706252fc 144
9aff1963 145include Makefile
cd230693 146
147# workaround segfault for this file seen on:
148# Apple LLVM version 4.2 (clang-425.0.27) (based on LLVM 3.2svn)
149libpcsxcore/new_dynarec/pcsxmem.o: libpcsxcore/new_dynarec/pcsxmem.c
150 $(CC) -c -o $@ $< $(CPPFLAGS) $(CFLAGS) -Os
af32009f 151
152# no special AS needed for gpu_neon
153plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o: plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
154 $(CC) $(CFLAGS) -c $^ -o $@