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