psxcounters: don't do many spu updates
[pcsx_rearmed.git] / Makefile.libretro
... / ...
CommitLineData
1# Makefile for PCSX ReARMed (libretro)
2
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
16CC ?= gcc
17CXX ?= g++
18AS ?= as
19CC_AS ?= $(CC)
20CFLAGS ?=
21
22TARGET_NAME := pcsx_rearmed
23
24ifeq ($(platform), unix)
25 TARGET := $(TARGET_NAME)_libretro.so
26 fpic := -fPIC
27 SHARED := -shared -Wl,--version-script=libretro/link.T
28else ifeq ($(platform), osx)
29 TARGET := $(TARGET_NAME)_libretro.dylib
30 fpic := -fPIC
31 SHARED := -dynamiclib
32 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
33 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
34ifeq ($(OSX_LT_MAVERICKS),"YES")
35 fpic += -mmacosx-version-min=10.5
36endif
37else ifeq ($(platform), ios)
38ARCH := arm
39 TARGET := $(TARGET_NAME)_libretro_ios.dylib
40 fpic := -fPIC
41 SHARED := -dynamiclib
42
43ifeq ($(IOSSDK),)
44 IOSSDK := $(shell xcrun -sdk iphoneos -show-sdk-path)
45endif
46
47 CC = clang -arch armv7 -isysroot $(IOSSDK)
48 CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
49 CC_AS = perl ./tools/gas-preprocessor.pl $(CC)
50 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
51 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
52 HAVE_NEON = 1
53 BUILTIN_GPU = neon
54 USE_DYNAREC = 1
55 CFLAGS += -DIOS
56 OSXVER = `sw_vers -productVersion | cut -d. -f 2`
57 OSX_LT_MAVERICKS = `(( $(OSXVER) <= 9)) && echo "YES"`
58ifeq ($(OSX_LT_MAVERICKS),"YES")
59 CC += -miphoneos-version-min=5.0
60 CXX += -miphoneos-version-min=5.0
61 CC_AS += -miphoneos-version-min=5.0
62 CFLAGS += -miphoneos-version-min=5.0
63endif
64else ifeq ($(platform), ps3)
65 TARGET := $(TARGET_NAME)_libretro_ps3.a
66 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
67 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
68 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
69else ifeq ($(platform), sncps3)
70 TARGET := $(TARGET_NAME)_libretro_ps3.a
71 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
72 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
73 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
74else ifeq ($(platform), psl1ght)
75 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
76 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
77 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
78 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
79else ifeq ($(platform), psp1)
80 TARGET := $(TARGET_NAME)_libretro_psp1.a
81 CC = psp-gcc$(EXE_EXT)
82 AR = psp-ar$(EXE_EXT)
83 CFLAGS += -DPSP -G0
84else ifeq ($(platform), xenon)
85 TARGET := $(TARGET_NAME)_libretro_xenon360.a
86 CC = xenon-gcc$(EXE_EXT)
87 AR = xenon-ar$(EXE_EXT)
88 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
89else ifeq ($(platform), ngc)
90 TARGET := $(TARGET_NAME)_libretro_ngc.a
91 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
92 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
93 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
94else ifeq ($(platform), wii)
95 TARGET := libretro_$(TARGET_NAME)_wii.a
96 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
97 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
98 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
99else ifeq ($(platform), qnx)
100 TARGET := $(TARGET_NAME)_libretro_qnx.so
101 CC = qcc -Vgcc_ntoarmv7le
102 CC_AS = $(CC)
103 HAVE_NEON = 1
104 USE_DYNAREC = 1
105 DRC_CACHE_BASE = 0
106 BUILTIN_GPU = neon
107 ARCH = arm
108 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
109 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
110else ifneq (,$(findstring armv,$(platform)))
111 TARGET := $(TARGET_NAME)_libretro.so
112 SHARED := -shared -Wl,--no-undefined
113 DRC_CACHE_BASE = 0
114ifneq (,$(findstring cortexa8,$(platform)))
115 CFLAGS += -marm -mcpu=cortex-a8
116 ASFLAGS += -mcpu=cortex-a8
117else ifneq (,$(findstring cortexa9,$(platform)))
118 CFLAGS += -marm -mcpu=cortex-a9
119 ASFLAGS += -mcpu=cortex-a9
120endif
121 CFLAGS += -marm
122ifneq (,$(findstring neon,$(platform)))
123 CFLAGS += -mfpu=neon
124 ASFLAGS += -mfpu=neon
125 HAVE_NEON = 1
126 BUILTIN_GPU = neon
127endif
128ifneq (,$(findstring softfloat,$(platform)))
129 CFLAGS += -mfloat-abi=softfp
130 ASFLAGS += -mfloat-abi=softfp
131else ifneq (,$(findstring hardfloat,$(platform)))
132 CFLAGS += -mfloat-abi=hard
133 ASFLAGS += -mfloat-abi=hard
134endif
135 ARCH = arm
136 USE_DYNAREC = 1
137else
138 TARGET := $(TARGET_NAME)_libretro.dll
139 CC = gcc
140 fpic := -fPIC
141 LD_FLAGS := -fPIC
142 SHARED := -shared -static-libgcc -static-libstdc++ -s -Wl,--version-script=libretro/link.T
143 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
144endif
145
146CFLAGS += -fPIC
147ifneq ($(platform),qnx)
148 LDLIBS += -lpthread
149 MAIN_LDLIBS += -ldl
150endif
151MAIN_LDFLAGS += -shared
152MAIN_LDLIBS += -lm -lz
153EXTRA_LDFLAGS =
154
155TARGET ?= libretro.so
156PLATFORM = libretro
157BUILTIN_GPU ?= peops
158SOUND_DRIVERS = libretro
159PLUGINS =
160NO_CONFIG_MAK = yes
161
162include Makefile
163
164# no special AS needed for gpu_neon
165plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.o: plugins/gpu_neon/psx_gpu/psx_gpu_arm_neon.S
166 $(CC) $(CFLAGS) -c $^ -o $@