(iOS) Add min SDK version flags
[picodrive.git] / Makefile.libretro
... / ...
CommitLineData
1# Makefile for PicoDrive (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 := picodrive
23
24asm_memory = 0
25asm_render = 0
26asm_ym2612 = 0
27asm_misc = 0
28asm_cdpico = 0
29asm_cdmemory = 0
30asm_mix = 0
31
32ifeq ($(platform), unix)
33 TARGET := $(TARGET_NAME)_libretro.so
34 SHARED := -shared
35else ifeq ($(platform), osx)
36 TARGET := $(TARGET_NAME)_libretro.dylib
37 SHARED := -dynamiclib
38else ifeq ($(platform), ios)
39 TARGET := $(TARGET_NAME)_libretro_ios.dylib
40 SHARED := -dynamiclib
41
42 CC = clang -arch armv7 -isysroot $(IOSSDK) -miphoneos-version-min=5.0
43 CXX = clang++ -arch armv7 -isysroot $(IOSSDK) -miphoneos-version-min=5.0
44 CC_AS = perl ./tools/gas-preprocessor.pl $(CC) -miphoneos-version-min=5.0
45 CFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon -marm
46 ASFLAGS += -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=neon
47 CFLAGS += -DIOS -miphoneos-version-min=5.0
48
49 ARCH := arm
50
51 use_cyclone = 0
52 use_fame = 1
53 use_drz80 = 0
54 use_cz80 = 1
55 use_sh2drc = 1
56 use_svpdrc = 1
57
58else ifeq ($(platform), ps3)
59 TARGET := $(TARGET_NAME)_libretro_ps3.a
60 CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
61 AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
62 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
63else ifeq ($(platform), sncps3)
64 TARGET := $(TARGET_NAME)_libretro_ps3.a
65 CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
66 AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
67 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
68else ifeq ($(platform), psl1ght)
69 TARGET := $(TARGET_NAME)_libretro_psl1ght.a
70 CC = $(PS3DEV)/ppu/bin/ppu-gcc$(EXE_EXT)
71 AR = $(PS3DEV)/ppu/bin/ppu-ar$(EXE_EXT)
72 CFLAGS += -DBLARGG_BIG_ENDIAN=1 -D__ppc__
73else ifeq ($(platform), psp1)
74 TARGET := $(TARGET_NAME)_libretro_psp1.a
75 CC = psp-gcc$(EXE_EXT)
76 AR = psp-ar$(EXE_EXT)
77 CFLAGS += -DPSP -G0
78else ifeq ($(platform), xenon)
79 TARGET := $(TARGET_NAME)_libretro_xenon360.a
80 CC = xenon-gcc$(EXE_EXT)
81 AR = xenon-ar$(EXE_EXT)
82 CFLAGS += -D__LIBXENON__ -m32 -D__ppc__
83else ifeq ($(platform), ngc)
84 TARGET := $(TARGET_NAME)_libretro_ngc.a
85 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
86 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
87 CFLAGS += -DGEKKO -DHW_DOL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
88else ifeq ($(platform), wii)
89 TARGET := libretro_$(TARGET_NAME)_wii.a
90 CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
91 AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
92 CFLAGS += -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -DBLARGG_BIG_ENDIAN=1 -D__ppc__
93else ifeq ($(platform), qnx)
94 TARGET := $(TARGET_NAME)_libretro_qnx.so
95 CC = qcc -Vgcc_ntoarmv7le
96 CC_AS = $(CC)
97 CFLAGS += -DBASE_ADDR_FIXED=0 -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
98 ASFLAGS += -mcpu=cortex-a9 -mfpu=neon -mfloat-abi=softfp
99
100 ARCH = arm
101 ARM_ASM = 1
102else ifneq (,$(findstring armv,$(platform)))
103 TARGET := $(TARGET_NAME)_libretro.so
104 SHARED := -shared -Wl,--no-undefined
105ifneq (,$(findstring cortexa8,$(platform)))
106 CFLAGS += -marm -mcpu=cortex-a8
107 ASFLAGS += -mcpu=cortex-a8
108else ifneq (,$(findstring cortexa9,$(platform)))
109 CFLAGS += -marm -mcpu=cortex-a9
110 ASFLAGS += -mcpu=cortex-a9
111endif
112 CFLAGS += -marm
113ifneq (,$(findstring neon,$(platform)))
114 CFLAGS += -mfpu=neon
115 ASFLAGS += -mfpu=neon
116endif
117ifneq (,$(findstring softfloat,$(platform)))
118 CFLAGS += -mfloat-abi=softfp
119 ASFLAGS += -mfloat-abi=softfp
120else ifneq (,$(findstring hardfloat,$(platform)))
121 CFLAGS += -mfloat-abi=hard
122 ASFLAGS += -mfloat-abi=hard
123endif
124ifneq (,$(findstring armasm,$(platform)))
125 ARM_ASM = 1
126endif
127 ARCH = arm
128else
129 TARGET := $(TARGET_NAME)_retro.dll
130 CC = gcc
131 LD_FLAGS := -fPIC
132 SHARED := -shared -static-libgcc -static-libstdc++
133 CFLAGS += -D__WIN32__ -D__WIN32_LIBRETRO__
134endif
135
136ifeq ($(ARM_ASM),1)
137asm_memory = 1
138asm_render = 1
139asm_ym2612 = 1
140asm_misc = 1
141asm_cdpico = 1
142asm_cdmemory = 1
143asm_mix = 1
144endif
145
146CFLAGS += -fPIC
147LDLIBS += -lm
148SHARED ?= -shared
149LDFLAGS += $(SHARED)
150
151PLATFORM = libretro
152NO_CONFIG_MAK = yes
153
154include Makefile