forked from voorhees1979/PUAE
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile.libretro
186 lines (161 loc) · 6.95 KB
/
Makefile.libretro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
EMU = src
LIBCOOBJ = src/td-retro/libco
LIBUTILS = src/utils
LIBRETRO = src/od-retro
GUI = src/gui-retro
CORE_SRCS2 := \
$(EMU)/main.o $(EMU)/newcpu.o $(EMU)/memory.o $(EMU)/rommgr.o $(EMU)/custom.o \
$(EMU)/serial.o $(EMU)/dongle.o $(EMU)/cia.o \
$(EMU)/blitter.o $(EMU)/blittable.o $(EMU)/blitfunc.o $(EMU)/autoconf.o $(EMU)/traps.o\
$(EMU)/keybuf.o $(EMU)/expansion.o $(EMU)/inputrecord.o $(EMU)/keymap/keymap.o\
$(EMU)/diskutil.o $(EMU)/zfile.o $(EMU)/zfile_archive.o $(EMU)/cfgfile.o $(EMU)/inputdevice.o \
$(EMU)/gfxutil.o $(EMU)/gfxlib.o $(EMU)/audio.o $(EMU)/sinctable.o $(EMU)/statusline.o $(EMU)/drawing.o $(EMU)/consolehook.o \
$(EMU)/native2amiga.o $(EMU)/disk.o $(EMU)/crc32.o $(EMU)/savestate.o $(EMU)/arcadia.o $(EMU)/cd32_fmv.o \
$(EMU)/uaeexe.o $(EMU)/uaelib.o $(EMU)/uaeresource.o $(EMU)/uaeserial.o $(EMU)/fdi2raw.o\
$(EMU)/hotkeys.o $(EMU)/amax.o \
$(EMU)/ar.o $(EMU)/driveclick.o $(EMU)/enforcer.o $(EMU)/misc.o $(EMU)/uaenet.o $(EMU)/a2065.o \
$(EMU)/missing.o $(EMU)/readcpu.o $(EMU)/hrtmon.rom.o $(EMU)/events.o $(EMU)/calc.o\
$(EMU)/aros.rom.o $(EMU)/specialmonitors.o $(EMU)/writelog.o $(EMU)/debug.o\
$(EMU)/identify.o $(EMU)/osdep/memory.o $(EMU)/osdep/parser.o $(EMU)/osdep/main.o
#$(EMU)/blkdev.o $(EMU)/blkdev_cdimage.o $(EMU)/picasso96.o $(EMU)/cdtv.o $(EMU)/akiko.o $(EMU)/a2091.o
# $(EMU)/scsi.o $(EMU)/ncr_scsi.o $(EMU)/gayle.o
CORE_SRCS2 += $(EMU)/archivers/dms/crc_csum.o $(EMU)/archivers/dms/getbits.o $(EMU)/archivers/dms/maketbl.o \
$(EMU)/archivers/dms/pfile.o $(EMU)/archivers/dms/tables.o \
$(EMU)/archivers/dms/u_deep.o $(EMU)/archivers/dms/u_heavy.o \
$(EMU)/archivers/dms/u_init.o $(EMU)/archivers/dms/u_medium.o $(EMU)/archivers/dms/u_quick.o \
$(EMU)/archivers/dms/u_rle.o
CORE_SRCS2 += \
$(EMU)/hardfile.o $(EMU)/hardfile_unix.o $(EMU)/scsi-none.o $(EMU)/fsusage.o \
$(EMU)/filesys.o $(EMU)/filesys_unix.o $(EMU)/fsdb.o $(EMU)/fsdb_unix.o $(EMU)/bsdsocket.o \
$(EMU)/cpuemu_0.o $(EMU)/cpuemu_11.o $(EMU)/cpuemu_12.o $(EMU)/cpuemu_20.o $(EMU)/cpuemu_21.o \
$(EMU)/cpuemu_22.o $(EMU)/cpustbl.o $(EMU)/cpudefs.o $(EMU)/cpuemu_31.o $(EMU)/cpuemu_32.o \
$(EMU)/cpuemu_33.o $(EMU)/cpummu.o $(EMU)/cpummu30.o $(EMU)/fpp.o
CORE_SRCS2 += $(EMU)/machdep/support.o $(EMU)/osdep/gui.o $(EMU)/osdep/retroglue.o $(EMU)/sounddep/sound.o \
$(EMU)/osdep/retromenu.o $(EMU)/threaddep/thread.o
DLG_SRCS = $(GUI)/dialog.o\
$(GUI)/paths.o \
$(GUI)/file.o \
$(GUI)/unzip.o \
$(GUI)/thumb.o \
$(GUI)/zip.o \
$(GUI)/str.o \
$(GUI)/dlgFloppy.o \
$(GUI)/dlgHardDisk.o \
$(GUI)/dlgFileSelect.o \
$(GUI)/dlgMemory.o \
$(GUI)/dlgJoystick.o \
$(GUI)/dlgAbout.o \
$(GUI)/dlgSound.o \
$(GUI)/dlgAlert.o \
$(GUI)/dlgMain.o \
$(GUI)/dlgMisc.o \
$(GUI)/dlgVideo.o \
$(GUI)/dlgRom.o \
$(GUI)/dlgSystem.o \
$(GUI)/sdlgui.o
LIBCO_SRCS = $(LIBCOOBJ)/libco.o
ifeq ($(platform),android)
LIBCO_SRCS += $(LIBCOOBJ)/armeabi_asm.o
else
UNAME_M := $(shell uname -m)
ifneq ($(filter arm%,$(UNAME_M)),)
LIBCO_SRCS += $(LIBCOOBJ)/armeabi_asm.o
endif
endif
BUILD_APP = $(CORE_SRCS2) $(LIBCO_SRCS)
HINCLUDES := -I./$(EMU) -I./$(EMU)/include -I$(LIBUTILS)
OBJECTS := $(BUILD_APP)
#OBJECTS := $(BUILD_APP) $(LIBRETRO)/libretro.o $(LIBRETRO)/euae-mapper.o $(LIBRETRO)/vkbd.o $(LIBRETRO)/graph.o $(LIBRETRO)/diskutils.o $(LIBRETRO)/fontmsx.o
PLATFLAGS :=
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
TARGET_NAME := puae
ifeq ($(platform), unix)
CC = gcc
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
LDFLAGS := -lz -lpthread
SHARED := -shared -Wl,--version-script=$(LIBRETRO)/link.T
else ifeq ($(platform), osx)
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC -mmacosx-version-min=10.6
SHARED := -dynamiclib
PLATFLAGS += -DRETRO -DLSB_FIRST -DALIGN_DWORD -D__LIBRETRO__
else ifeq ($(platform), android)
CC = arm-linux-androideabi-gcc
AR = @arm-linux-androideabi-ar
LD = @arm-linux-androideabi-g++
TARGET := $(TARGET_NAME)_libretro_android.so
fpic := -fPIC
LDFLAGS := -lz
SHARED := -Wl,--fix-cortex-a8 -shared -Wl,--version-script=$(LIBRETRO)/link.T -Wl,--no-undefined
PLATFLAGS += -DANDROID -DRETRO -DAND -DLSB_FIRST -DALIGN_DWORD -D__LIBRETRO__ -DANDPORT -DARM_OPT_TEST=1
else ifeq ($(platform), wii)
TARGET := $(TARGET_NAME)_libretro_wii.a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
ZLIB_DIR = $(LIBUTILS)/zlib/
CFLAGS += -DSDL_BYTEORDER=SDL_BIG_ENDIAN -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN -DBYTE_ORDER=BIG_ENDIAN \
-DWIIPORT=1 -DHAVE_MEMALIGN -DHAVE_ASPRINTF -I$(ZLIB_DIR) -I$(DEVKITPRO)/libogc/include \
-D__powerpc__ -D__POWERPC__ -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -D__ppc__
LDFLAGS := -lm -lpthread -lc
PLATFLAGS += -DRETRO -DALIGN_DWORD -DWIIPORT
else ifeq ($(platform), ps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
ZLIB_DIR = $(LIBUTILS)/zlib/
LDFLAGS := -lm -lpthread -lc
CFLAGS += -DSDL_BYTEORDER=SDL_BIG_ENDIAN -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN -DBYTE_ORDER=BIG_ENDIAN \
-D__CELLOS_LV2 -DPS3PORT=1 -DHAVE_MEMALIGN -DHAVE_ASPRINTF -I$(ZLIB_DIR)
PLATFLAGS += -DRETRO -DALIGN_DWORD
else
ifeq ($(subplatform), 32)
CC = i586-mingw32msvc-gcc
else
CC = x86_64-w64-mingw32-gcc
CFLAGS += -fno-aggressive-loop-optimizations
endif
PLATFLAGS += -DRETRO -DLSB_FIRST -DALIGN_DWORD -DWIN32PORT -DWIN32
TARGET := $(TARGET_NAME)_libretro.dll
fpic := -fPIC
SHARED := -shared -static-libgcc -s -Wl,--version-script=$(LIBRETRO)/link.T -Wl,--no-undefined
LDFLAGS := -lm -lz
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -Ofast
endif
DEFINES += -DCPUEMU_0 -DCPUEMU_11 -DCPUEMU_12 -DCPUEMU_20 -DCPUEMU_21 -DCPUEMU_22 -DFPUEMU -DUNALIGNED_PROFITABLE -DAMAX -DAGA -DAUTOCONFIG -DFILESYS -DSUPPORT_THREADS -DFDI2RAW -DDEBUGGER -DSAVESTATE -DENFORCER -DACTION_REPLAY -DXARCADE -DCPUEMU_31 -DCPUEMU_32 -DCPUEMU_33 -DMMUEMU -DFULLMMU -DDRIVESOUND
#-DSCSIEMU -DSCSIEMU_LINUX_IOCTL -DUSE_SDL -DDRIVESOUND -DBSDSOCKET -DCDTV -DCD32 -DA2091 -DNCR -DGAYLE
CFLAGS += $(DEFINES) -DRETRO=1 -std=gnu99
all: $(TARGET)
ifeq ($(platform), wii)
$(TARGET): $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
else ifeq ($(platform), ps3)
$(TARGET): $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
else ifeq ($(platform), win)
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) $(LDFLAGS)
else
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS)
endif
%.o: %.c
$(CC) $(fpic) $(CFLAGS) $(PLATFLAGS) $(HINCLUDES) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean