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