-
Notifications
You must be signed in to change notification settings - Fork 1
/
make.sh
executable file
·253 lines (239 loc) · 10.4 KB
/
make.sh
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
src="."
obj="$src/compiled"
CC=cc
AS=as
#CC=C:/MinGW/bin/gcc.exe
#AS=C:/MinGW/bin/as.exe
#FLAGS_GTK=pkg-config gtk+-2.0 --cflags -D_GTK2
FLAGS_ANSI="\
-I/usr/include/SDL \
-S \
-Os \
-ansi \
-std=c89 \
-pedantic \
-Wall \
-pipe"
FLAGS_x86_64="\
-I/usr/include/SDL \
-I/usr/include/gtk-1.2 \
-I/usr/include/glib-1.2 \
-I/usr/lib64/glib/include \
-fPIC \
-S \
-masm=att \
-w \
-Wno-sign-compare \
-Wno-pointer-to-int-cast \
-DX86 \
-DVCR_SUPPORT \
-O3 \
-msse2 \
-fexpensive-optimizations \
-fomit-frame-pointer \
-funroll-loops \
-ffast-math \
-fno-strict-aliasing"
C_FLAGS=$FLAGS_x86_64
mkdir -p $obj/main/win
mkdir -p $obj/memory
mkdir -p $obj/r4300/x86
echo Compiling Mupen64 core...
$CC $C_FLAGS -o $obj/main/main.s $src/main/main.c
$CC $C_FLAGS -o $obj/main/main_gtk.s $src/main/main_gtk.c
$CC $C_FLAGS -o $obj/main/gtk_gui.s $src/main/gui_gtk/main_gtk.c
#$CC $C_FLAGS -o $obj/main/win/main_win.s $src/main/win/main_win.c
$CC $C_FLAGS -o $obj/main/config.s $src/main/gui_gtk/config.c
$CC $C_FLAGS -o $obj/main/plugin.s $src/main/plugin.c
$CC $C_FLAGS -o $obj/main/rom.s $src/main/rom.c
$CC $C_FLAGS -o $obj/main/ioapi.s $src/main/ioapi.c
$CC $C_FLAGS -o $obj/main/adler32.s $src/main/adler32.c
$CC $C_FLAGS -o $obj/main/md5.s $src/main/md5.c
$CC $C_FLAGS -o $obj/main/mupenIniApi.s $src/main/mupenIniApi.c
$CC $C_FLAGS -o $obj/main/savestates.s $src/main/savestates.c
#$CC $C_FLAGS -o $obj/main/plugin.s $src/main/plugin.c
$CC $C_FLAGS -o $obj/main/unzip.s $src/main/unzip.c
$CC $C_FLAGS -o $obj/memory/memory.s $src/memory/memory.c
$CC $C_FLAGS -o $obj/memory/pif.s $src/memory/pif.c
$CC $C_FLAGS -o $obj/memory/dma.s $src/memory/dma.c
$CC $C_FLAGS -o $obj/memory/tlb.s $src/memory/tlb.c
$CC $C_FLAGS -o $obj/memory/flashram.s $src/memory/flashram.c
$CC $C_FLAGS -o $obj/r4300/r4300.s $src/r4300/r4300.c
$CC $C_FLAGS -o $obj/r4300/interupt.s $src/r4300/interupt.c
$CC $C_FLAGS -o $obj/r4300/exception.s $src/r4300/exception.c
$CC $C_FLAGS -o $obj/r4300/special.s $src/r4300/special.c
$CC $C_FLAGS -o $obj/r4300/regimm.s $src/r4300/regimm.c
$CC $C_FLAGS -o $obj/r4300/cop0.s $src/r4300/cop0.c
$CC $C_FLAGS -o $obj/r4300/tlb.s $src/r4300/tlb.c
$CC $C_FLAGS -o $obj/r4300/cop1.s $src/r4300/cop1.c
$CC $C_FLAGS -o $obj/r4300/cop1_w.s $src/r4300/cop1_w.c
$CC $C_FLAGS -o $obj/r4300/cop1_s.s $src/r4300/cop1_s.c
$CC $C_FLAGS -o $obj/r4300/cop1_d.s $src/r4300/cop1_d.c
$CC $C_FLAGS -o $obj/r4300/cop1_l.s $src/r4300/cop1_l.c
$CC $C_FLAGS -o $obj/r4300/bc.s $src/r4300/bc.c
#$CC $C_FLAGS -o $obj/r4300/compare_core.s $src/r4300/compare_core.c
#$CC $C_FLAGS -o $obj/r4300/profile.s $src/r4300/profile.c
$CC $C_FLAGS -o $obj/r4300/pure_interp.s $src/r4300/pure_interp.c
$CC $C_FLAGS -o $obj/r4300/recomp.s $src/r4300/recomp.c
echo Compiling Mupen64 x86 libraries...
$CC $C_FLAGS -o $obj/r4300/x86/gr4300.s $src/r4300/x86/gr4300.c
$CC $C_FLAGS -o $obj/r4300/x86/assemble.s $src/r4300/x86/assemble.c
$CC $C_FLAGS -o $obj/r4300/x86/gspecial.s $src/r4300/x86/gspecial.c
$CC $C_FLAGS -o $obj/r4300/x86/gregimm.s $src/r4300/x86/gregimm.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop0.s $src/r4300/x86/gcop0.c
$CC $C_FLAGS -o $obj/r4300/x86/gtlb.s $src/r4300/x86/gtlb.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop1.s $src/r4300/x86/gcop1.c
$CC $C_FLAGS -o $obj/r4300/x86/gbc.s $src/r4300/x86/gbc.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop1_s.s $src/r4300/x86/gcop1_s.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop1_d.s $src/r4300/x86/gcop1_d.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop1_w.s $src/r4300/x86/gcop1_w.c
$CC $C_FLAGS -o $obj/r4300/x86/gcop1_l.s $src/r4300/x86/gcop1_l.c
$CC $C_FLAGS -o $obj/r4300/x86/rjump.s $src/r4300/x86/rjump.c
$CC $C_FLAGS -o $obj/r4300/x86/debug.s $src/r4300/x86/debug.c
$CC $C_FLAGS -o $obj/r4300/x86/regcache.s $src/r4300/x86/regcache.c
echo Compiling Mupen64 VCR support...
$CC $C_FLAGS -o $obj/main/vcr.s $src/main/vcr.c
$CC $C_FLAGS -o $obj/main/vcr_resample.s $src/main/vcr_resample.c
#$CC $C_FLAGS -o $obj/main/win/vcr_compress.s $src/main/win/vcr_compress.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/vcrcomp_dialog.s $src/main/gui_gtk/vcrcomp_dialog.c
#echo Compiling Mupen64 GTK GUI...
#$CC $C_FLAGS -o $obj/main/gui_gtk/main_gtk.s $src/main/gui_gtk/main_gtk.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/translate.s $src/main/gui_gtk/translate.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/messagebox.s $src/main/gui_gtk/messagebox.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/aboutdialog.s $src/main/gui_gtk/aboutdialog.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/configdialog.s $src/main/gui_gtk/configdialog.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/support.s $src/main/gui_gtk/support.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/rombrowser.s $src/main/gui_gtk/rombrowser.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/romproperties.s $src/main/gui_gtk/romproperties.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/config.s $src/main/gui_gtk/config.c
#$CC $C_FLAGS -o $obj/main/gui_gtk/dirbrowser.s $src/main/gui_gtk/dirbrowser.c
echo Compiling Mupen64 GUI...
#$CC $C_FLAGS -o $obj/main/win/configdialog.s $src/main/win/configdialog.c
#$CC $C_FLAGS -o $obj/main/win/rombrowser.s $src/main/win/rombrowser.c
#$CC $C_FLAGS -o $obj/main/win/config.s $src/main/win/config.c
#$CC $C_FLAGS -o $obj/main/win/dumplist.s $src/main/win/dumplist.c
#$CC $C_FLAGS -o $obj/main/win/timers.s $src/main/win/timers.c
#$CC $C_FLAGS -o $obj/main/win/translation.s $src/main/win/translation.c
#$CC $C_FLAGS -o $obj/main/win/inifunctions.s $src/main/win/inifunctions.c
#$CC $C_FLAGS -o $obj/main/win/guifuncs.s $src/main/win/guifuncs.c
#$CC $C_FLAGS -o $obj/main/win/RomSettings.s $src/main/win/RomSettings.c
#$CC $C_FLAGS -o $obj/main/win/GUI_LogWindow.s $src/main/win/GUI_LogWindow.c
#$CC $C_FLAGS -o $obj/main/win/kaillera.s $src/main/win/kaillera.c
#$CC $C_FLAGS -o $obj/main/win/commandline.s $src/main/win/commandline.c
#windres -i $src/winproject/mupen64_private.rc --input-format=rc -o $obj/mupen64_private.res -O coff
echo Assembling compiled sources...
#$AS -o $obj/main/win/main_win.o $obj/main/win/main_win.s
$AS -o $obj/main/gtk_gui.o $obj/main/gtk_gui.s
$AS -o $obj/main/config.o $obj/main/config.s
$AS -o $obj/main/plugin.o $obj/main/plugin.s
$AS -o $obj/main/main_gtk.o $obj/main/main_gtk.s
$AS -o $obj/main/main.o $obj/main/main.s
$AS -o $obj/main/rom.o $obj/main/rom.s
$AS -o $obj/main/ioapi.o $obj/main/ioapi.s
$AS -o $obj/main/adler32.o $obj/main/adler32.s
$AS -o $obj/main/md5.o $obj/main/md5.s
$AS -o $obj/main/mupenIniApi.o $obj/main/mupenIniApi.s
$AS -o $obj/main/savestates.o $obj/main/savestates.s
$AS -o $obj/main/unzip.o $obj/main/unzip.s
$AS -o $obj/memory/memory.o $obj/memory/memory.s
$AS -o $obj/memory/pif.o $obj/memory/pif.s
$AS -o $obj/memory/dma.o $obj/memory/dma.s
$AS -o $obj/memory/tlb.o $obj/memory/tlb.s
$AS -o $obj/memory/flashram.o $obj/memory/flashram.s
$AS -o $obj/r4300/r4300.o $obj/r4300/r4300.s
$AS -o $obj/r4300/interupt.o $obj/r4300/interupt.s
$AS -o $obj/r4300/exception.o $obj/r4300/exception.s
$AS -o $obj/r4300/special.o $obj/r4300/special.s
$AS -o $obj/r4300/regimm.o $obj/r4300/regimm.s
$AS -o $obj/r4300/cop0.o $obj/r4300/cop0.s
$AS -o $obj/r4300/tlb.o $obj/r4300/tlb.s
$AS -o $obj/r4300/cop1.o $obj/r4300/cop1.s
$AS -o $obj/r4300/cop1_w.o $obj/r4300/cop1_w.s
$AS -o $obj/r4300/cop1_s.o $obj/r4300/cop1_s.s
$AS -o $obj/r4300/cop1_d.o $obj/r4300/cop1_d.s
$AS -o $obj/r4300/cop1_l.o $obj/r4300/cop1_l.s
$AS -o $obj/r4300/bc.o $obj/r4300/bc.s
$AS -o $obj/r4300/pure_interp.o $obj/r4300/pure_interp.s
$AS -o $obj/r4300/recomp.o $obj/r4300/recomp.s
$AS -o $obj/r4300/x86/gr4300.o $obj/r4300/x86/gr4300.s
$AS -o $obj/r4300/x86/assemble.o $obj/r4300/x86/assemble.s
$AS -o $obj/r4300/x86/gspecial.o $obj/r4300/x86/gspecial.s
$AS -o $obj/r4300/x86/gregimm.o $obj/r4300/x86/gregimm.s
$AS -o $obj/r4300/x86/gcop0.o $obj/r4300/x86/gcop0.s
$AS -o $obj/r4300/x86/gtlb.o $obj/r4300/x86/gtlb.s
$AS -o $obj/r4300/x86/gcop1.o $obj/r4300/x86/gcop1.s
$AS -o $obj/r4300/x86/gbc.o $obj/r4300/x86/gbc.s
$AS -o $obj/r4300/x86/gcop1_s.o $obj/r4300/x86/gcop1_s.s
$AS -o $obj/r4300/x86/gcop1_d.o $obj/r4300/x86/gcop1_d.s
$AS -o $obj/r4300/x86/gcop1_w.o $obj/r4300/x86/gcop1_w.s
$AS -o $obj/r4300/x86/gcop1_l.o $obj/r4300/x86/gcop1_l.s
$AS -o $obj/r4300/x86/rjump.o $obj/r4300/x86/rjump.s
$AS -o $obj/r4300/x86/debug.o $obj/r4300/x86/debug.s
$AS -o $obj/r4300/x86/regcache.o $obj/r4300/x86/regcache.s
$AS -o $obj/main/vcr.o $obj/main/vcr.s
$AS -o $obj/main/vcr_resample.o $obj/main/vcr_resample.s
#$AS -o $obj/main/win/vcr_compress.o $obj/main/win/vcr_compress.s
#$AS -o $obj/main/win/configdialog.o $obj/main/win/configdialog.s
#$AS -o $obj/main/win/rombrowser.o $obj/main/win/rombrowser.s
#$AS -o $obj/main/win/config.o $obj/main/win/config.s
#$AS -o $obj/main/win/dumplist.o $obj/main/win/dumplist.s
#$AS -o $obj/main/win/timers.o $obj/main/win/timers.s
#$AS -o $obj/main/win/translation.o $obj/main/win/translation.s
#$AS -o $obj/main/win/inifunctions.o $obj/main/win/inifunctions.s
#$AS -o $obj/main/win/guifuncs.o $obj/main/win/guifuncs.s
#$AS -o $obj/main/win/RomSettings.o $obj/main/win/RomSettings.s
#$AS -o $obj/main/win/GUI_LogWindow.o $obj/main/win/GUI_LogWindow.s
#$AS -o $obj/main/win/kaillera.o $obj/main/win/kaillera.s
#$AS -o $obj/main/win/commandline.o $obj/main/win/commandline.s
# to do: Get GTK to work? Or just remove it and let the Makefile build w/ GTK.
OBJ_LIST="\
$obj/main/main.o \
$obj/main/plugin.o \
$obj/main/config.o \
$obj/main/rom.o \
$obj/memory/memory.o \
$obj/r4300/x86/debug.o \
$obj/r4300/r4300.o \
$obj/main/unzip.o \
$obj/r4300/interupt.o \
$obj/memory/tlb.o \
$obj/memory/dma.o \
$obj/memory/pif.o \
$obj/r4300/exception.o \
$obj/r4300/recomp.o \
$obj/r4300/pure_interp.o \
$obj/r4300/x86/rjump.o \
$obj/main/ioapi.o \
$obj/r4300/x86/assemble.o \
$obj/r4300/x86/gr4300.o \
$obj/r4300/special.o \
$obj/r4300/x86/gspecial.o \
$obj/r4300/regimm.o \
$obj/r4300/x86/gregimm.o \
$obj/r4300/tlb.o \
$obj/r4300/x86/gtlb.o \
$obj/r4300/cop0.o \
$obj/r4300/x86/gcop0.o \
$obj/r4300/bc.o \
$obj/r4300/x86/gbc.o \
$obj/r4300/cop1_s.o \
$obj/r4300/x86/gcop1_s.o \
$obj/r4300/cop1_d.o \
$obj/r4300/x86/gcop1_d.o \
$obj/r4300/cop1_w.o \
$obj/r4300/x86/gcop1_w.o \
$obj/r4300/cop1_l.o \
$obj/r4300/x86/gcop1_l.o \
$obj/r4300/cop1.o \
$obj/r4300/x86/gcop1.o \
$obj/memory/flashram.o \
$obj/main/md5.o \
$obj/main/mupenIniApi.o \
$obj/main/savestates.o \
$obj/main/vcr.o \
$obj/r4300/x86/regcache.o \
$obj/main/vcr_resample.o \
$obj/main/adler32.o"
echo Linking assembled object files...
#$CC -mwindows $OBJ_LIST -o $obj/mupen64 -s -lz -lcomctl32 -lwinmm -lvfw_avi32 -lvfw_ms32
$CC $OBJ_LIST -o $obj/mupen64 -s -lz -lSDL -ldl -lpthread -lgtk -lglib -lgdk