-
Notifications
You must be signed in to change notification settings - Fork 43
/
Makefile
352 lines (310 loc) · 8.95 KB
/
Makefile
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
ifeq ($(PLATFORM),)
PLATFORM = rpi2
endif
ifeq ($(PLATFORM),rpi2)
CPU_FLAGS += -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
MORE_CFLAGS += -DRASPBERRY -DCAPSLOCK_DEBIAN_WORKAROUND -DARMV6T2 -DARM_HAS_DIV -DARMV6_ASSEMBLY -marm
LDFLAGS += -lbcm_host
HAVE_NEON = 1
HAVE_DISPMANX = 1
USE_PICASSO96 = 1
else ifeq ($(PLATFORM),rpi1)
CPU_FLAGS += -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard
MORE_CFLAGS += -DRASPBERRY -DCAPSLOCK_DEBIAN_WORKAROUND -DARMV6_ASSEMBLY -marm
LDFLAGS += -lbcm_host
HAVE_DISPMANX = 1
USE_PICASSO96 = 1
else ifeq ($(PLATFORM),rpi64bits)
CPU_FLAGS += -march=armv8-a -mtune=cortex-a53
MORE_CFLAGS += -DRASPBERRY -DCAPSLOCK_DEBIAN_WORKAROUND -DCPU_AARCH64
LDFLAGS += -lbcm_host
AARCH64 = 1
#HAVE_DISPMANX = 1
#HAVE_SDL_DISPLAY = 1
HAVE_GLES_DISPLAY = 1
USE_PICASSO96 = 1
LDFLAGS += -L/usr/lib/aarch64-linux-gnu/
else ifeq ($(PLATFORM),generic-sdl)
ifneq ($(findstring raspberrypi,$(shell uname -a)),)
CPU_FLAGS= -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
endif
MORE_CFLAGS += -DARMV6T2 -DARMV6_ASSEMBLY -marm
HAVE_SDL_DISPLAY = 1
else ifeq ($(PLATFORM),gles)
# Autodetect Rpi
ifneq ($(findstring raspberrypi,$(shell uname -a)),)
LDFLAGS += -lbcm_host
CPU_FLAGS= -mcpu=cortex-a7 -mfpu=neon-vfpv4 -mfloat-abi=hard
endif
# Uncomment below line to activate shader support. It's very slown on Allwinner.
#MORE_CFLAGS += -DSHADER_SUPPORT
# Uncomment below line to activate threading. This is buggy on Allwinner.
#MORE_CFLAGS += -DUSE_RENDER_THREAD
MORE_CFLAGS += -DARMV6T2 -DARMV6_ASSEMBLY -marm
HAVE_GLES_DISPLAY = 1
HAVE_NEON = 1
USE_PICASSO96 = 1
endif
GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null)
ifneq ($(GIT_VERSION),)
MORE_CFLAGS += -DGIT_VERSION=$(GIT_VERSION)
endif
NAME = uae4arm
RM = rm -f
CXX = g++
STRIP = strip
PROG = $(NAME)
all: $(PROG)
#DEBUG=1
#TRACER=1
PANDORA=1
#GEN_PROFILE=1
#USE_PROFILE=1
SDL_CFLAGS = `sdl-config --cflags`
DEFS += `xml2-config --cflags`
DEFS += -DCPU_arm -DPANDORA -DRP9_SUPPORT -DWITH_MPEG2 -DWITH_INGAME_WARNING -DUSE_SDL
ifeq ($(USE_PICASSO96), 1)
DEFS += -DPICASSO96
endif
ifeq ($(HAVE_NEON), 1)
DEFS += -DUSE_ARMNEON
endif
MORE_CFLAGS += -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
MORE_CFLAGS += -Isrc -Isrc/od-pandora -Isrc/threaddep -Isrc/menu -Isrc/include -Isrc/archivers -Isrc/od-pandora
MORE_CFLAGS += -fexceptions -fpermissive -std=gnu++11
LDFLAGS += -lSDL -lpthread -lm -lz -lSDL_image -lpng -lrt -lxml2 -lFLAC -lmpg123 -ldl -lmpeg2convert -lmpeg2
LDFLAGS += -lSDL_ttf -lguichan_sdl -lguichan -L/opt/vc/lib
ifndef DEBUG
MORE_CFLAGS += -O3 -fomit-frame-pointer -finline
else
MORE_CFLAGS += -g -DDEBUG -Wl,--export-dynamic -DWITH_LOGGING
#MORE_CFLAGS += -fsanitize=address -fsanitize=bounds
#LDFLAGS += -static-libasan -fsanitize=address -fsanitize=bounds
ifdef TRACER
TRACE_CFLAGS = -DTRACER -finstrument-functions -Wall -rdynamic
endif
endif
ASFLAGS += $(CPU_FLAGS)
CXXFLAGS += $(SDL_CFLAGS) $(CPU_FLAGS) $(DEFS) $(MORE_CFLAGS)
ifdef GEN_PROFILE
MORE_CFLAGS += -fprofile-generate=/media/MAINSD/pandora/test -fprofile-arcs -fvpt
endif
ifdef USE_PROFILE
MORE_CFLAGS += -fprofile-use -fbranch-probabilities -fvpt
endif
CAPS = capsimg.so
capsimg.so: capsimg
(cd capsimg ; ./bootstrap ; ./configure ; $(MAKE) ; cp capsimg.so ../ )
OBJS = \
src/akiko.o \
src/ar.o \
src/aros.rom.o \
src/audio.o \
src/autoconf.o \
src/blitfunc.o \
src/blittable.o \
src/blitter.o \
src/blkdev.o \
src/blkdev_cdimage.o \
src/bsdsocket.o \
src/calc.o \
src/cd32_fmv.o \
src/cd32_fmv_genlock.o \
src/cdrom.o \
src/cdtv.o \
src/cfgfile.o \
src/cia.o \
src/crc32.o \
src/custom.o \
src/def_icons.o \
src/devices.o \
src/disk.o \
src/diskutil.o \
src/dlopen.o \
src/drawing.o \
src/events.o \
src/expansion.o \
src/fdi2raw.o \
src/filesys.o \
src/flashrom.o \
src/fpp.o \
src/fsdb.o \
src/fsdb_unix.o \
src/fsusage.o \
src/gayle.o \
src/gfxboard.o \
src/gfxutil.o \
src/hardfile.o \
src/hrtmon.rom.o \
src/ide.o \
src/inputdevice.o \
src/isofs.o \
src/keybuf.o \
src/main.o \
src/memory.o \
src/native2amiga.o \
src/rommgr.o \
src/rtc.o \
src/savestate.o \
src/scsi.o \
src/scsiemul.o \
src/statusline.o \
src/traps.o \
src/uaelib.o \
src/uaeresource.o \
src/zfile.o \
src/zfile_archive.o \
src/archivers/7z/7zAlloc.o \
src/archivers/7z/7zBuf.o \
src/archivers/7z/7zCrc.o \
src/archivers/7z/7zCrcOpt.o \
src/archivers/7z/7zDec.o \
src/archivers/7z/7zIn.o \
src/archivers/7z/7zStream.o \
src/archivers/7z/Bcj2.o \
src/archivers/7z/Bra.o \
src/archivers/7z/Bra86.o \
src/archivers/7z/LzmaDec.o \
src/archivers/7z/Lzma2Dec.o \
src/archivers/7z/BraIA64.o \
src/archivers/7z/Delta.o \
src/archivers/7z/Sha256.o \
src/archivers/7z/Xz.o \
src/archivers/7z/XzCrc64.o \
src/archivers/7z/XzDec.o \
src/archivers/dms/crc_csum.o \
src/archivers/dms/getbits.o \
src/archivers/dms/maketbl.o \
src/archivers/dms/pfile.o \
src/archivers/dms/tables.o \
src/archivers/dms/u_deep.o \
src/archivers/dms/u_heavy.o \
src/archivers/dms/u_init.o \
src/archivers/dms/u_medium.o \
src/archivers/dms/u_quick.o \
src/archivers/dms/u_rle.o \
src/archivers/lha/crcio.o \
src/archivers/lha/dhuf.o \
src/archivers/lha/header.o \
src/archivers/lha/huf.o \
src/archivers/lha/larc.o \
src/archivers/lha/lhamaketbl.o \
src/archivers/lha/lharc.o \
src/archivers/lha/shuf.o \
src/archivers/lha/slide.o \
src/archivers/lha/uae_lha.o \
src/archivers/lha/util.o \
src/archivers/lzx/unlzx.o \
src/archivers/mp2/kjmp2.o \
src/archivers/wrp/warp.o \
src/archivers/zip/unzip.o \
src/caps/caps_win32.o \
src/md-pandora/support.o \
src/od-pandora/bsdsocket_host.o \
src/od-pandora/cda_play.o \
src/od-pandora/charset.o \
src/od-pandora/fsdb_host.o \
src/od-pandora/hardfile_pandora.o \
src/od-pandora/keyboard.o \
src/od-pandora/mp3decoder.o \
src/od-pandora/writelog.o \
src/od-pandora/pandora.o \
src/od-pandora/pandora_filesys.o \
src/od-pandora/pandora_input.o \
src/od-pandora/pandora_gui.o \
src/od-pandora/pandora_rp9.o \
src/od-pandora/pandora_mem.o \
src/od-pandora/sigsegv_handler.o \
src/sd-sdl/sound_sdl_new.o \
src/od-pandora/gui/UaeRadioButton.o \
src/od-pandora/gui/UaeDropDown.o \
src/od-pandora/gui/UaeCheckBox.o \
src/od-pandora/gui/UaeListBox.o \
src/od-pandora/gui/SelectorEntry.o \
src/od-pandora/gui/ShowHelp.o \
src/od-pandora/gui/ShowMessage.o \
src/od-pandora/gui/SelectFolder.o \
src/od-pandora/gui/SelectFile.o \
src/od-pandora/gui/CreateFilesysHardfile.o \
src/od-pandora/gui/EditFilesysVirtual.o \
src/od-pandora/gui/EditFilesysHardfile.o \
src/od-pandora/gui/PanelPaths.o \
src/od-pandora/gui/PanelQuickstart.o \
src/od-pandora/gui/PanelConfig.o \
src/od-pandora/gui/PanelCPU.o \
src/od-pandora/gui/PanelChipset.o \
src/od-pandora/gui/PanelROM.o \
src/od-pandora/gui/PanelRAM.o \
src/od-pandora/gui/PanelFloppy.o \
src/od-pandora/gui/PanelHD.o \
src/od-pandora/gui/PanelDisplay.o \
src/od-pandora/gui/PanelSound.o \
src/od-pandora/gui/PanelInput.o \
src/od-pandora/gui/PanelMisc.o \
src/od-pandora/gui/PanelSavestate.o \
src/od-pandora/gui/main_window.o \
src/od-pandora/gui/Navigation.o
ifeq ($(HAVE_DISPMANX), 1)
OBJS += src/od-rasp/rasp_gfx.o
endif
ifeq ($(HAVE_SDL_DISPLAY), 1)
OBJS += src/od-pandora/pandora_gfx.o
endif
ifeq ($(HAVE_GLES_DISPLAY), 1)
OBJS += src/od-gles/gl.o
OBJS += src/od-gles/shader_stuff.o
OBJS += src/od-gles/gl_platform.o
OBJS += src/od-gles/gles_gfx.o
MORE_CFLAGS += -I/opt/vc/include/
MORE_CFLAGS += -DHAVE_GLES
LDFLAGS += -ldl
ifneq (,$(wildcard /opt/vc/lib/libbrcmGLESv2.so))
LDFLAGS += -lbrcmEGL -lbrcmGLESv2
else
LDFLAGS += -L/usr/lib/arm-linux-gnueabihf/mali-egl
LDFLAGS += -lEGL -lGLESv2 -lGLESv1_CM
endif
endif
ifdef PANDORA
OBJS += src/od-pandora/gui/sdltruetypefont.o
endif
ifeq ($(USE_PICASSO96), 1)
OBJS += src/od-pandora/picasso96.o
endif
ifeq ($(AARCH64), 1)
OBJS += src/od-pandora/aarch64_helper.o
else ifeq ($(HAVE_NEON), 1)
OBJS += src/od-pandora/neon_helper.o
else
OBJS += src/od-pandora/arm_helper.o
endif
OBJS += src/newcpu.o
OBJS += src/newcpu_common.o
OBJS += src/readcpu.o
OBJS += src/cpudefs.o
OBJS += src/cpustbl.o
OBJS += src/cpuemu_0.o
OBJS += src/cpuemu_4.o
OBJS += src/cpuemu_11.o
OBJS += src/cpuemu_40.o
OBJS += src/cpuemu_44.o
OBJS += src/jit/compemu.o
OBJS += src/jit/compstbl.o
OBJS += src/jit/compemu_fpp.o
OBJS += src/jit/compemu_support.o
src/od-pandora/neon_helper.o: src/od-pandora/neon_helper.s
$(CXX) $(ASFLAGS) -Wall -o src/od-pandora/neon_helper.o -c src/od-pandora/neon_helper.s
src/od-pandora/arm_helper.o: src/od-pandora/arm_helper.s
$(CXX) $(ASFLAGS) -Wall -o src/od-pandora/arm_helper.o -c src/od-pandora/arm_helper.s
src/od-pandora/aarch64_helper.o: src/od-pandora/aarch64_helper.s
$(CXX) $(ASFLAGS) -Wall -o src/od-pandora/aarch64_helper.o -c src/od-pandora/aarch64_helper.s
src/trace.o: src/trace.c
$(CC) $(MORE_CFLAGS) -c src/trace.c -o src/trace.o
$(PROG): $(OBJS) $(CAPS)
$(CXX) -o $(PROG) $(OBJS) $(LDFLAGS)
ifndef DEBUG
$(STRIP) $(PROG)
endif
clean:
$(RM) $(PROG) $(OBJS) $(CAPS)
(cd capsimg ; make clean )