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