1
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2
# * Mupen64plus - Makefile *
3
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
4
# * Copyright (C) 2007-2008 DarkJeztr Tillin9 Richard42 *
6
# * This program is free software; you can redistribute it and/or modify *
7
# * it under the terms of the GNU General Public License as published by *
8
# * the Free Software Foundation; either version 2 of the License, or *
9
# * (at your option) any later version. *
11
# * This program is distributed in the hope that it will be useful, *
12
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14
# * GNU General Public License for more details. *
16
# * You should have received a copy of the GNU General Public License *
17
# * along with this program; if not, write to the *
18
# * Free Software Foundation, Inc., *
19
# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
20
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
22
# include pre-make file with a bunch of definitions
27
include ./pre.mk.win32
33
LDFLAGS += -Wl,-export-dynamic
36
# set executable stack as a linker option for X86 architecture, for dynamic recompiler
39
LDFLAGS += -z execstack
47
ifeq ($(DBG_COMPARE), 1)
48
CFLAGS += -DCOMPARE_CORE
53
ifeq ($(DBG_COUNT), 1)
54
CFLAGS += -DCOUNT_INSTR
56
ifeq ($(DBG_PROFILE), 1)
57
CFLAGS += -DPROFILE_R4300
66
CFLAGS += $(QT_FLAGS) $(GTK_FLAGS)
69
CFLAGS += $(GTK_FLAGS)
73
CFLAGS += $(GTK_FLAGS)
78
# set installation options
83
SHAREDIR := $(PREFIX)/share/mupen64plus
86
BINDIR := $(PREFIX)/bin
89
LIBDIR := $(SHAREDIR)/plugins
92
MANDIR := $(PREFIX)/man/man1
94
ifeq ($(APPLICATIONSDIR),)
95
APPLICATIONSDIR := $(PREFIX)/share/applications
98
INSTALLOPTS := "$(DESTDIR)$(PREFIX)" "$(DESTDIR)$(SHAREDIR)" "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(LIBDIR)" "$(DESTDIR)$(MANDIR)" "$(DESTDIR)$(APPLICATIONSDIR)"
100
# list of object files to generate
116
main/7zip/7zAlloc.o \
117
main/7zip/7zBuffer.o \
119
main/7zip/7zDecode.o \
120
main/7zip/7zExtract.o \
121
main/7zip/7zHeader.o \
125
main/7zip/LzmaDecode.o \
126
main/7zip/BranchX86.o \
127
main/7zip/BranchX86_2.o \
135
r4300/compare_core.o \
145
r4300/pure_interp.o \
151
# handle dynamic recompiler objects
154
ifeq ($(ARCH), 64BITS)
163
r4300/$(DYNAREC)/assemble.o \
164
r4300/$(DYNAREC)/debug.o \
165
r4300/$(DYNAREC)/gbc.o \
166
r4300/$(DYNAREC)/gcop0.o \
167
r4300/$(DYNAREC)/gcop1.o \
168
r4300/$(DYNAREC)/gcop1_d.o \
169
r4300/$(DYNAREC)/gcop1_l.o \
170
r4300/$(DYNAREC)/gcop1_s.o \
171
r4300/$(DYNAREC)/gcop1_w.o \
172
r4300/$(DYNAREC)/gr4300.o \
173
r4300/$(DYNAREC)/gregimm.o \
174
r4300/$(DYNAREC)/gspecial.o \
175
r4300/$(DYNAREC)/gtlb.o \
176
r4300/$(DYNAREC)/regcache.o \
177
r4300/$(DYNAREC)/rjump.o
179
OBJ_DYNAREC = r4300/empty_dynarec.o
191
main/gui_gtk/main_gtk.o \
192
main/gui_gtk/icontheme.o \
193
main/gui_gtk/aboutdialog.o \
194
main/gui_gtk/cheatdialog.o \
195
main/gui_gtk/configdialog.o \
196
main/gui_gtk/rombrowser.o \
197
main/gui_gtk/romproperties.o
200
debugger/debugger.o \
202
debugger/opprintf.o \
204
debugger/breakpoints.o
207
main/gui_gtk/debugger/debugger.o \
208
main/gui_gtk/debugger/breakpoints.o \
209
main/gui_gtk/debugger/desasm.o \
210
main/gui_gtk/debugger/memedit.o \
211
main/gui_gtk/debugger/varlist.o \
212
main/gui_gtk/debugger/registers.o \
213
main/gui_gtk/debugger/regGPR.o \
214
main/gui_gtk/debugger/regCop0.o \
215
main/gui_gtk/debugger/regSpecial.o \
216
main/gui_gtk/debugger/regCop1.o \
217
main/gui_gtk/debugger/regAI.o \
218
main/gui_gtk/debugger/regPI.o \
219
main/gui_gtk/debugger/regRI.o \
220
main/gui_gtk/debugger/regSI.o \
221
main/gui_gtk/debugger/regVI.o \
222
main/gui_gtk/debugger/regTLB.o \
223
main/gui_gtk/debugger/ui_clist_edit.o \
224
main/gui_gtk/debugger/ui_disasm_list.o
226
OBJ_QT4_GUI = main/gui_qt4/libgui_qt4.a
228
PLUGINS = plugins/blight_input.$(SO_EXTENSION) \
229
plugins/dummyaudio.$(SO_EXTENSION) \
230
plugins/dummyvideo.$(SO_EXTENSION) \
231
plugins/ricevideo.$(SO_EXTENSION) \
232
plugins/glide64.$(SO_EXTENSION) \
233
plugins/jttl_audio.$(SO_EXTENSION) \
234
plugins/mupen64_hle_rsp_azimer.$(SO_EXTENSION) \
235
plugins/mupen64_input.$(SO_EXTENSION)
237
SHARE = $(shell grep CONFIG_PATH config.h | cut -d '"' -f 2)
239
# set primary objects and libraries for all outputs
240
ALL = mupen64plus $(PLUGINS)
241
OBJECTS = $(OBJ_CORE) $(OBJ_DYNAREC) $(OBJ_OPENGL)
242
LIBS = $(SDL_LIBS) $(LIBGL_LIBS) $(XDGBASEDIR_LIBS) -lbz2
244
CFLAGS+= $(XDGBASEDIR_FLAGS)
246
# add extra objects and libraries for selected options
248
OBJECTS += $(OBJ_DBG) $(OBJ_GTK_DBG_GUI)
249
STATIC_LIBS += /usr/lib/libopcodes.a
252
OBJECTS += $(OBJ_LIRC)
253
LDFLAGS += -llirc_client
256
ifneq ($(OS), WINDOWS)
257
MISC_DEPS = mupen64plus.desktop
261
OBJECTS += $(OBJ_QT4_GUI)
262
LIBS += $(QT_LIBS) $(GTK_LIBS)
264
# we reimplement the translation functions in the Qt gui
265
OBJECTS += main/translate.o
267
OBJECTS += $(OBJ_GTK_GUI)
268
LIBS += $(GTK_LIBS) $(GTHREAD_LIBS)
274
@echo "Mupen64Plus makefile. "
276
@echo " all == Build Mupen64Plus and all plugins"
277
@echo " clean == remove object files (also try clean-core or clean-plugins)"
278
@echo " rebuild == clean and re-build all"
279
@echo " install == Install Mupen64Plus and all plugins"
280
@echo " uninstall == Uninstall Mupen64Plus and all plugins"
282
@echo " BITS=32 == build 32-bit binaries on 64-bit machine"
283
@echo " LIRC=1 == enable LIRC support"
284
@echo " NO_RESAMP=1 == disable libsamplerate support in jttl_audio"
285
@echo " NO_ASM=1 == build without assembly (no dynamic recompiler or MMX/SSE code)"
286
@echo " GUI=NONE == build without GUI support"
287
@echo " GUI=GTK2 == build with GTK2 GUI support (default)"
288
@echo " GUI=QT4 == build with QT4 GUI support"
289
@echo " WIN32=1 == mingw build"
290
@echo " Install Options:"
291
@echo " PREFIX=path == install/uninstall prefix (default: /usr/local/)"
292
@echo " SHAREDIR=path == path to install shared data (default: PREFIX/share/mupen64plus/)"
293
@echo " BINDIR=path == path to install mupen64plus binary (default: PREFIX/bin/)"
294
@echo " LIBDIR=path == path to install plugin libraries (default: SHAREDIR/plugins/)"
295
@echo " MANDIR=path == path to install manual files (default: PREFIX/man/man1/)"
296
@echo " Debugging Options:"
297
@echo " PROFILE=1 == build gprof instrumentation into binaries for profiling"
298
@echo " DBGSYM=1 == add debugging symbols to binaries"
299
@echo " DBG=1 == build graphical debugger"
300
@echo " DBG_CORE=1 == print debugging info in r4300 core"
301
@echo " DBG_COUNT=1 == print R4300 instruction count totals (64-bit dynarec only)"
302
@echo " DBG_COMPARE=1 == enable core-synchronized r4300 debugging"
303
@echo " DBG_PROFILE=1 == dump profiling data for r4300 dynarec to data file"
304
# @echo " RELEASE=1 == inhibit SVN info from version strings"
305
# @echo " VER=x.y.z == use this version number when RELEASE=1"
306
# The RELEASE and VER flags are hidden from view as they should only be used internally.
307
# They only affect the version strings
309
all: version.h $(ALL)
311
mupen64plus: $(MISC_DEPS) version.h $(OBJECTS)
312
$(CXX) $(OBJECTS) $(LDFLAGS) $(CORE_LDFLAGS) $(LIBS) -o $@ $(STATIC_LIBS)
313
ifneq ($(OS), WINDOWS)
318
./install.sh $(INSTALLOPTS)
321
./uninstall.sh $(INSTALLOPTS)
324
ifneq ($(OS), WINDOWS)
325
$(MAKE) -C blight_input clean
326
$(MAKE) -C dummy_audio clean
327
$(MAKE) -C dummy_video clean
328
$(MAKE) -C rice_video clean
329
$(MAKE) -C glide64 clean
330
$(MAKE) -C jttl_audio clean
331
$(MAKE) -C rsp_hle clean
332
$(MAKE) -C mupen64_input clean
333
$(RM_F) plugins/mupen64_input.$(SO_EXTENSION) blight_input/arial.ttf.c blight_input/ttftoh plugins/blight_input.$(SO_EXTENSION) plugins/mupen64_hle_rsp_azimer.$(SO_EXTENSION)
334
$(RM_F) plugins/dummyaudio.$(SO_EXTENSION) plugins/dummyvideo.$(SO_EXTENSION) plugins/jttl_audio.$(SO_EXTENSION) plugins/ricevideo.$(SO_EXTENSION) plugins/glide64.$(SO_EXTENSION)
338
ifneq ($(OS), WINDOWS)
339
$(RM_F) ./r4300/*.o ./r4300/x86/*.o ./r4300/x86_64/*.o ./memory/*.o ./debugger/*.o ./opengl/*.o
340
$(RM_F) ./main/*.o ./main/version.h ./main/zip/*.o ./main/lzma/*.o ./main/7zip/*.o ./main/gui_gtk/*.o ./main/gui_gtk/debugger/*.o
341
$(RM_F) mupen64plus mupen64plus.desktop
342
$(RM_F) main/gui_qt4/moc_* main/gui_qt4/ui_*.h main/gui_qt4/*.o main/gui_qt4/*.a main/gui_qt4/Makefile
343
$(RM_F) translations/*.qm
345
del /S *.o *.$(SO_EXTENSION) mupen64plus.exe moc_* *.a *.qm
350
clean: clean-core clean-plugins
355
mupen64plus.desktop: FORCE
356
@sed s:SHARE_DIR:"$(SHAREDIR)": mupen64plus.desktop.in > mupen64plus.desktop
359
ifneq ($(OS), WINDOWS)
360
@sed 's|@MUPEN_VERSION@|\"$(MUPEN_VERSION)\"| ; s|@PLUGIN_VERSION@|\"$(PLUGIN_VERSION)\"|' \
361
main/version.template > version.h
362
@$(MV) version.h main/version.h
364
copy version.win32.h main\version.h
368
$(CXX) -o $@ $(CFLAGS) $(SDL_FLAGS) -c $<
371
$(CC) -o $@ $(CFLAGS) $(SDL_FLAGS) -c $<
373
main/gui_qt4/Makefile:
374
${QMAKE} main/gui_qt4/gui_qt4.pro -o main/gui_qt4/Makefile
376
main/gui_qt4/libgui_qt4.a: main/gui_qt4/Makefile FORCE
377
ifneq ($(OS), WINDOWS)
378
${MAKE} -C main/gui_qt4
379
# Run lrelease only on ts files with locale suffix, makes no sense to run it on
380
# the template. For some reason this fails on windows.
381
${LRELEASE} translations/*_*.ts
383
# I wonder whether we can avoid this somehow
384
${MAKE} -C main/gui_qt4 CXXFLAGS="${CFLAGS}"
385
copy main\gui_qt4\release\libgui_qt4.a main\gui_qt4
388
plugins/blight_input.$(SO_EXTENSION): FORCE
389
$(MAKE) -C blight_input all
390
ifneq ($(OS), WINDOWS)
391
@$(CP) ./blight_input/blight_input.so ./plugins/blight_input.so
393
copy blight_input\blight_input.dll plugins
396
plugins/dummyaudio.$(SO_EXTENSION): FORCE
397
$(MAKE) -C dummy_audio all
398
ifneq ($(OS), WINDOWS)
399
@$(CP) ./dummy_audio/dummyaudio.so ./plugins/dummyaudio.so
401
copy dummy_audio\dummyaudio.dll plugins
404
plugins/dummyvideo.$(SO_EXTENSION): FORCE
405
$(MAKE) -C dummy_video all
406
ifneq ($(OS), WINDOWS)
407
@$(CP) ./dummy_video/dummyvideo.so ./plugins/dummyvideo.so
409
copy dummy_video\dummyvideo.dll plugins
412
plugins/ricevideo.$(SO_EXTENSION): FORCE
413
$(MAKE) -C rice_video all
414
@$(CP) ./rice_video/ricevideo.$(SO_EXTENSION) ./plugins/ricevideo.$(SO_EXTENSION)
416
plugins/glide64.$(SO_EXTENSION): FORCE
417
$(MAKE) -C glide64 all
418
@$(CP) ./glide64/glide64.$(SO_EXTENSION) ./plugins/glide64.$(SO_EXTENSION)
420
plugins/jttl_audio.$(SO_EXTENSION): FORCE
421
$(MAKE) -C jttl_audio all
422
@$(CP) ./jttl_audio/jttl_audio.$(SO_EXTENSION) ./plugins/jttl_audio.$(SO_EXTENSION)
424
plugins/mupen64_hle_rsp_azimer.$(SO_EXTENSION): FORCE
425
$(MAKE) -C rsp_hle all
426
@$(CP) ./rsp_hle/mupen64_hle_rsp_azimer.$(SO_EXTENSION) ./plugins/mupen64_hle_rsp_azimer.$(SO_EXTENSION)
428
plugins/mupen64_input.$(SO_EXTENSION): FORCE
429
$(MAKE) -C mupen64_input all
430
@$(CP) ./mupen64_input/mupen64_input.$(SO_EXTENSION) ./plugins/mupen64_input.$(SO_EXTENSION)
432
# This is used to force the plugin builds