2446536b |
1 | # Makefile for PicoDrive (libretro) |
2 | |
3 | ifeq ($(platform),) |
4 | platform = unix |
5 | ifeq ($(shell uname -a),) |
6 | platform = win |
7 | else ifneq ($(findstring MINGW,$(shell uname -a)),) |
8 | platform = win |
9 | else ifneq ($(findstring Darwin,$(shell uname -a)),) |
10 | platform = osx |
11 | else ifneq ($(findstring win,$(shell uname -a)),) |
12 | platform = win |
13 | endif |
14 | endif |
15 | |
16 | CC ?= gcc |
17 | CXX ?= g++ |
18 | AS ?= as |
19 | CC_AS ?= $(CC) |
20 | CFLAGS ?= |
21 | |
22 | TARGET_NAME := picodrive |
23 | |
087a176d |
24 | asm_memory = 0 |
25 | asm_render = 0 |
26 | asm_ym2612 = 0 |
27 | asm_misc = 0 |
28 | asm_cdpico = 0 |
29 | asm_cdmemory = 0 |
30 | asm_mix = 0 |
31 | |
2446536b |
32 | ifeq ($(platform), unix) |
33 | TARGET := $(TARGET_NAME)_libretro.so |
34 | SHARED := -shared |
35 | else ifeq ($(platform), osx) |
36 | TARGET := $(TARGET_NAME)_libretro.dylib |
37 | SHARED := -dynamiclib |
38 | else 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 |
61 | else 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__ |
66 | else 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__ |
71 | else 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__ |
76 | else 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 |
81 | else 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__ |
86 | else 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__ |
91 | else 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__ |
96 | else 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 |
107 | else ifneq (,$(findstring armv,$(platform))) |
70b8542a |
108 | TARGET := $(TARGET_NAME)_libretro.so |
109 | SHARED := -shared -Wl,--no-undefined |
087a176d |
110 | ifneq (,$(findstring cortexa8,$(platform))) |
111 | CFLAGS += -marm -mcpu=cortex-a8 |
112 | ASFLAGS += -mcpu=cortex-a8 |
113 | else ifneq (,$(findstring cortexa9,$(platform))) |
114 | CFLAGS += -marm -mcpu=cortex-a9 |
115 | ASFLAGS += -mcpu=cortex-a9 |
116 | endif |
117 | CFLAGS += -marm |
118 | ifneq (,$(findstring neon,$(platform))) |
119 | CFLAGS += -mfpu=neon |
120 | ASFLAGS += -mfpu=neon |
121 | HAVE_NEON = 1 |
122 | endif |
123 | ifneq (,$(findstring softfloat,$(platform))) |
124 | CFLAGS += -mfloat-abi=softfp |
70b8542a |
125 | ASFLAGS += -mfloat-abi=softfp |
087a176d |
126 | else ifneq (,$(findstring hardfloat,$(platform))) |
127 | CFLAGS += -mfloat-abi=hard |
128 | ASFLAGS += -mfloat-abi=hard |
129 | endif |
130 | ifneq (,$(findstring armasm,$(platform))) |
131 | ARM_ASM = 1 |
132 | endif |
2446536b |
133 | ARCH = arm |
2446536b |
134 | USE_DYNAREC = 1 |
135 | else |
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__ |
141 | endif |
142 | |
087a176d |
143 | ifeq ($(ARM_ASM),1) |
144 | asm_memory = 1 |
145 | asm_render = 1 |
146 | asm_ym2612 = 1 |
147 | asm_misc = 1 |
148 | asm_cdpico = 1 |
149 | asm_cdmemory = 1 |
150 | asm_mix = 1 |
34e7fb0b |
151 | endif |
087a176d |
152 | |
2446536b |
153 | CFLAGS += -fPIC |
154 | LDLIBS += -lm |
155 | SHARED ?= -shared |
156 | LDFLAGS += $(SHARED) |
157 | |
158 | PLATFORM = libretro |
159 | NO_CONFIG_MAK = yes |
160 | |
161 | include Makefile |