forked from BlitterStudio/amiberry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
238 lines (211 loc) · 5.82 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
ifeq ($(PLATFORM),)
PLATFORM = rpi3
endif
ifeq ($(PLATFORM),rpi3)
CPU_FLAGS += -march=armv8-a -mfpu=neon-fp-armv8 -mfloat-abi=hard
MORE_CFLAGS += -DARMV6T2 -DUSE_ARMNEON
else ifeq ($(PLATFORM),rpi2)
CPU_FLAGS += -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard
MORE_CFLAGS += -DARMV6T2 -DUSE_ARMNEON
else ifeq ($(PLATFORM),rpi1)
CPU_FLAGS += -march=armv6zk -mfpu=vfp -mfloat-abi=hard
endif
NAME = amiberry
RM = rm -f
CC = gcc
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 -DARMV6_ASSEMBLY -DPANDORA -DPICASSO96
DEFS += -DWITH_INGAME_WARNING -DRASPBERRY -DCAPSLOCK_DEBIAN_WORKAROUND
DEFS += -DROM_PATH_PREFIX=\"./\" -DDATA_PREFIX=\"./data/\" -DSAVE_PREFIX=\"./saves/\"
DEFS += -DUSE_SDL
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/osdep -Isrc/threaddep -Isrc/include
MORE_CFLAGS += -Wno-unused -Wno-format -DGCCCONSTFUNC="__attribute__((const))"
MORE_CFLAGS += -fexceptions -fpermissive
LDFLAGS += -lSDL -lpthread -lm -lz -lSDL_image -lpng -lrt -lxml2 -lFLAC -lmpg123 -ldl
LDFLAGS += -lSDL_ttf -lguichan_sdl -lguichan -lbcm_host -L/opt/vc/lib
ifndef DEBUG
MORE_CFLAGS += -Ofast -pipe
else
MORE_CFLAGS += -g -DDEBUG -Wl,--export-dynamic
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=/home/pi/projects/amiberry -fprofile-arcs -fvpt
endif
ifdef USE_PROFILE
MORE_CFLAGS += -fprofile-use -fbranch-probabilities -fvpt
endif
OBJS = \
src/akiko.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/cdrom.o \
src/cfgfile.o \
src/cia.o \
src/crc32.o \
src/custom.o \
src/disk.o \
src/diskutil.o \
src/drawing.o \
src/events.o \
src/expansion.o \
src/filesys.o \
src/fpp.o \
src/fsdb.o \
src/fsdb_unix.o \
src/fsusage.o \
src/gfxboard.o \
src/gfxutil.o \
src/hardfile.o \
src/inputdevice.o \
src/keybuf.o \
src/main.o \
src/memory.o \
src/native2amiga.o \
src/rommgr.o \
src/savestate.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/7zDecode.o \
src/archivers/7z/7zExtract.o \
src/archivers/7z/7zHeader.o \
src/archivers/7z/7zIn.o \
src/archivers/7z/7zItem.o \
src/archivers/7z/7zBuf.o \
src/archivers/7z/7zCrc.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/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/wrp/warp.o \
src/archivers/zip/unzip.o \
src/machdep/support.o \
src/osdep/bsdsocket_host.o \
src/osdep/cda_play.o \
src/osdep/charset.o \
src/osdep/fsdb_host.o \
src/osdep/hardfile_pandora.o \
src/osdep/keyboard.o \
src/osdep/mp3decoder.o \
src/osdep/writelog.o \
src/osdep/pandora.o \
src/osdep/pandora_filesys.o \
src/osdep/pandora_input.o \
src/osdep/pandora_gui.o \
src/osdep/pandora_rp9.o \
src/osdep/pandora_mem.o \
src/osdep/sigsegv_handler.o \
src/osdep/menu/menu_config.o \
src/sounddep/sound_sdl_new.o \
src/osdep/gui/UaeRadioButton.o \
src/osdep/gui/UaeDropDown.o \
src/osdep/gui/UaeCheckBox.o \
src/osdep/gui/UaeListBox.o \
src/osdep/gui/InGameMessage.o \
src/osdep/gui/SelectorEntry.o \
src/osdep/gui/ShowMessage.o \
src/osdep/gui/SelectFolder.o \
src/osdep/gui/SelectFile.o \
src/osdep/gui/CreateFilesysHardfile.o \
src/osdep/gui/EditFilesysVirtual.o \
src/osdep/gui/EditFilesysHardfile.o \
src/osdep/gui/PanelPaths.o \
src/osdep/gui/PanelConfig.o \
src/osdep/gui/PanelCPU.o \
src/osdep/gui/PanelChipset.o \
src/osdep/gui/PanelROM.o \
src/osdep/gui/PanelRAM.o \
src/osdep/gui/PanelFloppy.o \
src/osdep/gui/PanelHD.o \
src/osdep/gui/PanelDisplay.o \
src/osdep/gui/PanelSound.o \
src/osdep/gui/PanelInput.o \
src/osdep/gui/PanelMisc.o \
src/osdep/gui/PanelSavestate.o \
src/osdep/gui/main_window.o \
src/osdep/gui/Navigation.o
OBJS += src/osdep/rasp_gfx.o
OBJS += src/osdep/gui/sdltruetypefont.o
OBJS += src/osdep/picasso96.o
ifeq ($(PLATFORM),rpi1)
OBJS += src/osdep/arm_helper.o
else
OBJS += src/osdep/neon_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/jit/compemu.o
OBJS += src/jit/compstbl.o
OBJS += src/jit/compemu_fpp.o
OBJS += src/jit/compemu_support.o
src/osdep/neon_helper.o: src/osdep/neon_helper.s
$(CXX) $(CPU_FLAGS) -Wall -o src/osdep/neon_helper.o -c src/osdep/neon_helper.s
src/osdep/arm_helper.o: src/osdep/arm_helper.s
$(CXX) $(CPU_FLAGS) -Wall -o src/osdep/arm_helper.o -c src/osdep/arm_helper.s
src/trace.o: src/trace.c
$(CC) $(MORE_CFLAGS) -c src/trace.c -o src/trace.o
$(PROG): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(PROG) $(OBJS) $(LDFLAGS)
ifndef DEBUG
$(STRIP) $(PROG)
endif
clean:
$(RM) $(PROG) $(OBJS)