~ubuntu-branches/ubuntu/quantal/mupen64plus/quantal

« back to all changes in this revision

Viewing changes to .pc/noexecstack.patch/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Sven Eckelmann, Sven Eckelmann, Piotr Ożarowski
  • Date: 2010-05-06 11:34:46 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100506113446-jfcd6uk7waudel82
Tags: 1.5+dfsg1-10
[ Sven Eckelmann ]
* debian/patches:
  - Add rsp_ucode2_reset.patch, Reset status of specific ucode2 hacks after
    starting again
  - Add rsp_hle_bigendian.patch, Fix wrong high level emulation of rsp on big
    endian systems
  - Add rice-crash-vendorstring.patch, Don't crash on long OpenGL vendor
    string (Closes: #580480, LP: #575968)

[ Piotr Ożarowski ]
* DMUA flag set to yes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
2
# *   Mupen64plus - Makefile                                                *
 
3
# *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
 
4
# *   Copyright (C) 2007-2008 DarkJeztr Tillin9 Richard42                   *
 
5
# *                                                                         *
 
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.                                   *
 
10
# *                                                                         *
 
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.                          *
 
15
# *                                                                         *
 
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
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
21
 
 
22
# include pre-make file with a bunch of definitions
 
23
USES_QT4 = true
 
24
USES_GTK2 = true
 
25
 
 
26
ifeq ($(WIN32),1)
 
27
  include ./pre.mk.win32
 
28
else
 
29
  include ./pre.mk
 
30
endif
 
31
 
 
32
ifeq ($(OS), LINUX)
 
33
  LDFLAGS += -Wl,-export-dynamic
 
34
endif
 
35
 
 
36
# set executable stack as a linker option for X86 architecture, for dynamic recompiler
 
37
ifeq ($(CPU), X86)
 
38
  ifeq ($(OS), LINUX)
 
39
    LDFLAGS += -z execstack
 
40
  endif
 
41
endif
 
42
 
 
43
# set options
 
44
ifeq ($(DBG), 1)
 
45
  CFLAGS += -DDBG
 
46
endif
 
47
ifeq ($(DBG_COMPARE), 1)
 
48
  CFLAGS += -DCOMPARE_CORE
 
49
endif
 
50
ifeq ($(DBG_CORE), 1)
 
51
  CFLAGS += -DCORE_DBG
 
52
endif
 
53
ifeq ($(DBG_COUNT), 1)
 
54
  CFLAGS += -DCOUNT_INSTR
 
55
endif
 
56
ifeq ($(DBG_PROFILE), 1)
 
57
  CFLAGS += -DPROFILE_R4300
 
58
endif
 
59
ifeq ($(LIRC), 1)
 
60
  CFLAGS += -DWITH_LIRC
 
61
endif
 
62
ifeq ($(GUI), NONE)
 
63
  CFLAGS += -DNO_GUI
 
64
else
 
65
  ifeq ($(GUI), QT4)
 
66
  CFLAGS += $(QT_FLAGS) $(GTK_FLAGS)
 
67
  LDFLAGS += $(QT_LIBS)
 
68
    ifeq ($(DBG), 1)
 
69
      CFLAGS += $(GTK_FLAGS)
 
70
    endif
 
71
  else
 
72
    ifeq ($(GUI), GTK2)
 
73
      CFLAGS += $(GTK_FLAGS)
 
74
    endif
 
75
  endif
 
76
endif
 
77
 
 
78
# set installation options
 
79
ifeq ($(PREFIX),)
 
80
  PREFIX := /usr/local
 
81
endif
 
82
ifeq ($(SHAREDIR),)
 
83
  SHAREDIR := $(PREFIX)/share/mupen64plus
 
84
endif
 
85
ifeq ($(BINDIR),)
 
86
  BINDIR := $(PREFIX)/bin
 
87
endif
 
88
ifeq ($(LIBDIR),)
 
89
  LIBDIR := $(SHAREDIR)/plugins
 
90
endif
 
91
ifeq ($(MANDIR),)
 
92
  MANDIR := $(PREFIX)/man/man1
 
93
endif
 
94
ifeq ($(APPLICATIONSDIR),)
 
95
  APPLICATIONSDIR := $(PREFIX)/share/applications
 
96
endif
 
97
 
 
98
INSTALLOPTS := "$(DESTDIR)$(PREFIX)" "$(DESTDIR)$(SHAREDIR)" "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(LIBDIR)" "$(DESTDIR)$(MANDIR)" "$(DESTDIR)$(APPLICATIONSDIR)"
 
99
 
 
100
# list of object files to generate
 
101
OBJ_CORE = \
 
102
        main/main.o \
 
103
        main/romcache.o \
 
104
        main/util.o \
 
105
        main/cheat.o \
 
106
        main/config.o \
 
107
        main/md5.o \
 
108
        main/plugin.o \
 
109
        main/rom.o \
 
110
        main/savestates.o \
 
111
        main/zip/ioapi.o \
 
112
        main/zip/unzip.o \
 
113
        main/lzma/buffer.o \
 
114
        main/lzma/io.o \
 
115
        main/lzma/main.o \
 
116
        main/7zip/7zAlloc.o \
 
117
        main/7zip/7zBuffer.o \
 
118
        main/7zip/7zCrc.o \
 
119
        main/7zip/7zDecode.o \
 
120
        main/7zip/7zExtract.o \
 
121
        main/7zip/7zHeader.o \
 
122
        main/7zip/7zIn.o \
 
123
        main/7zip/7zItem.o \
 
124
        main/7zip/7zMain.o \
 
125
        main/7zip/LzmaDecode.o \
 
126
        main/7zip/BranchX86.o \
 
127
        main/7zip/BranchX86_2.o \
 
128
        memory/dma.o \
 
129
        memory/flashram.o \
 
130
        memory/memory.o \
 
131
        memory/pif.o \
 
132
        memory/tlb.o \
 
133
        r4300/r4300.o \
 
134
        r4300/bc.o \
 
135
        r4300/compare_core.o \
 
136
        r4300/cop0.o \
 
137
        r4300/cop1.o \
 
138
        r4300/cop1_d.o \
 
139
        r4300/cop1_l.o \
 
140
        r4300/cop1_s.o \
 
141
        r4300/cop1_w.o \
 
142
        r4300/exception.o \
 
143
        r4300/interupt.o \
 
144
        r4300/profile.o \
 
145
        r4300/pure_interp.o \
 
146
        r4300/recomp.o \
 
147
        r4300/special.o \
 
148
        r4300/regimm.o \
 
149
        r4300/tlb.o
 
150
 
 
151
# handle dynamic recompiler objects
 
152
ifneq ($(NO_ASM), 1)
 
153
  ifeq ($(CPU), X86)
 
154
    ifeq ($(ARCH), 64BITS)
 
155
      DYNAREC = x86_64
 
156
    else
 
157
      DYNAREC = x86
 
158
    endif
 
159
  endif
 
160
endif
 
161
ifneq ($(DYNAREC), )
 
162
  OBJ_DYNAREC = \
 
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
 
178
else
 
179
  OBJ_DYNAREC = r4300/empty_dynarec.o
 
180
endif
 
181
 
 
182
OBJ_LIRC = \
 
183
        main/lirc.o
 
184
 
 
185
OBJ_OPENGL = \
 
186
        opengl/OGLFT.o \
 
187
        opengl/osd.o \
 
188
        opengl/screenshot.o
 
189
 
 
190
OBJ_GTK_GUI = \
 
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
 
198
 
 
199
OBJ_DBG = \
 
200
        debugger/debugger.o \
 
201
        debugger/decoder.o \
 
202
        debugger/opprintf.o \
 
203
        debugger/memory.o \
 
204
        debugger/breakpoints.o
 
205
 
 
206
OBJ_GTK_DBG_GUI = \
 
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
 
225
 
 
226
OBJ_QT4_GUI = main/gui_qt4/libgui_qt4.a
 
227
 
 
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)
 
236
 
 
237
SHARE = $(shell grep CONFIG_PATH config.h | cut -d '"' -f 2)
 
238
 
 
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
 
243
STATIC_LIBS =
 
244
CFLAGS+= $(XDGBASEDIR_FLAGS)
 
245
 
 
246
# add extra objects and libraries for selected options
 
247
ifeq ($(DBG), 1)
 
248
  OBJECTS +=  $(OBJ_DBG) $(OBJ_GTK_DBG_GUI)
 
249
  STATIC_LIBS += /usr/lib/libopcodes.a
 
250
endif
 
251
ifeq ($(LIRC), 1)
 
252
  OBJECTS += $(OBJ_LIRC)
 
253
  LDFLAGS += -llirc_client
 
254
endif
 
255
ifneq ($(GUI), NONE)
 
256
  ifneq ($(OS), WINDOWS)
 
257
    MISC_DEPS = mupen64plus.desktop
 
258
  endif
 
259
endif
 
260
ifeq ($(GUI), QT4)
 
261
  OBJECTS += $(OBJ_QT4_GUI)
 
262
  LIBS += $(QT_LIBS) $(GTK_LIBS)
 
263
else
 
264
  # we reimplement the translation functions in the Qt gui
 
265
  OBJECTS += main/translate.o
 
266
  ifneq ($(GUI), NONE)
 
267
    OBJECTS += $(OBJ_GTK_GUI)
 
268
    LIBS += $(GTK_LIBS) $(GTHREAD_LIBS)
 
269
  endif
 
270
endif
 
271
 
 
272
# build targets
 
273
targets:
 
274
        @echo "Mupen64Plus makefile. "
 
275
        @echo "  Targets:"
 
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"
 
281
        @echo "  Options:"
 
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
 
308
 
 
309
all: version.h $(ALL)
 
310
 
 
311
mupen64plus: $(MISC_DEPS) version.h $(OBJECTS)
 
312
        $(CXX) $(OBJECTS) $(LDFLAGS) $(CORE_LDFLAGS) $(LIBS) -o $@ $(STATIC_LIBS)
 
313
ifneq ($(OS), WINDOWS)
 
314
        $(STRIP) $@
 
315
endif
 
316
 
 
317
install:
 
318
        ./install.sh $(INSTALLOPTS)
 
319
 
 
320
uninstall:
 
321
        ./uninstall.sh $(INSTALLOPTS)
 
322
 
 
323
clean-plugins:
 
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)
 
335
endif
 
336
 
 
337
clean-core:
 
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
 
344
else
 
345
        del /S *.o *.$(SO_EXTENSION) mupen64plus.exe moc_* *.a *.qm
 
346
        cd main\gui_qt4
 
347
        del /S ui_*.h
 
348
endif
 
349
 
 
350
clean: clean-core clean-plugins
 
351
 
 
352
rebuild: clean all
 
353
 
 
354
# build rules
 
355
mupen64plus.desktop: FORCE
 
356
        @sed s:SHARE_DIR:"$(SHAREDIR)": mupen64plus.desktop.in > mupen64plus.desktop
 
357
 
 
358
version.h: FORCE
 
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
 
363
else
 
364
        copy version.win32.h main\version.h
 
365
endif
 
366
 
 
367
.cpp.o:
 
368
        $(CXX) -o $@ $(CFLAGS) $(SDL_FLAGS) -c $<
 
369
 
 
370
.c.o:
 
371
        $(CC) -o $@ $(CFLAGS) $(SDL_FLAGS) -c $<
 
372
 
 
373
main/gui_qt4/Makefile:
 
374
        ${QMAKE} main/gui_qt4/gui_qt4.pro -o main/gui_qt4/Makefile
 
375
 
 
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
 
382
else
 
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
 
386
endif
 
387
 
 
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
 
392
else
 
393
        copy blight_input\blight_input.dll plugins
 
394
endif
 
395
 
 
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
 
400
else
 
401
        copy dummy_audio\dummyaudio.dll plugins
 
402
endif
 
403
 
 
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
 
408
else
 
409
        copy dummy_video\dummyvideo.dll plugins
 
410
endif
 
411
 
 
412
plugins/ricevideo.$(SO_EXTENSION): FORCE
 
413
        $(MAKE) -C rice_video all
 
414
        @$(CP) ./rice_video/ricevideo.$(SO_EXTENSION) ./plugins/ricevideo.$(SO_EXTENSION)
 
415
 
 
416
plugins/glide64.$(SO_EXTENSION): FORCE
 
417
        $(MAKE) -C glide64 all
 
418
        @$(CP) ./glide64/glide64.$(SO_EXTENSION) ./plugins/glide64.$(SO_EXTENSION)
 
419
 
 
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)
 
423
 
 
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)
 
427
 
 
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)
 
431
 
 
432
# This is used to force the plugin builds
 
433
FORCE:
 
434