This repository has been archived by the owner on Jan 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile.gcw0
94 lines (78 loc) · 4.12 KB
/
Makefile.gcw0
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
#/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
# * Mupen64plus - Makefile *
# * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
# * Copyright (C) 2014 Paul Cercueil *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 2 of the License, or *
# * (at your option) any later version. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with this program; if not, write to the *
# * Free Software Foundation, Inc., *
# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
CROSS_COMPILE := mipsel-linux-
CC := $(CROSS_COMPILE)gcc
SYSROOT := $(shell $(CC) --print-sysroot)
PKG_CONFIG := env PKG_CONFIG_SYSROOT_DIR=$(SYSROOT) PKG_CONFIG_LIBDIR=$(SYSROOT)/usr/lib/pkgconfig pkg-config
SDL_CONFIG := $(SYSROOT)/usr/bin/sdl2-config
CFLAGS := -DSDL_VIDEO_OPENGL_ES2 -DMESA_EGL_NO_X11_HEADERS
# put -Dname=value in CFLAGS for conditional compilation
OPTFLAGS := -O3 -flto
# put -O3 in OPTFLAGS if you want linking to be faster, or -O3 -flto for runtime
UNAME := linux
HOST_CPU := mips
OSD := 0
NO_OSS := 1
NO_SRC := 1
NO_SPEEX := 1
export CROSS_COMPILE CC CFLAGS OPTFLAGS UNAME HOST_CPU OSD NO_OSS NO_SRC NO_SPEEX
# override the location of these tools
MAKE_OPTS := PKG_CONFIG="$(PKG_CONFIG)" SDL_CONFIG="$(SDL_CONFIG)" USE_GLES=1
DATE := $(shell date -u +"%Y-%m-%d %H:%M:%S UTC")
.PHONY: clean all opk core input audio ui out/default.gcw0.desktop input-sdl audio-sdl rsp-hle mupen64plus video-gles2n64
opk: mupen64plus.opk
all: core input audio rsp ui video
input: input-sdl
audio: audio-sdl
rsp: rsp-hle
ui: mupen64plus
video: video-gles2n64
mupen64plus.opk: out out/mupen.png out/default.gcw0.desktop all
mksquashfs $< $@ -all-root -noappend -no-exports -no-xattrs
out/mupen.png: mupen.png out
cp $< $@
out/default.gcw0.desktop: default.gcw0.desktop out
sed "s/DATE/$(DATE)/g" $< > $@
core: out
+make -C ../mupen64plus-core/projects/unix $(MAKE_OPTS) all
cp ../mupen64plus-core/projects/unix/libmupen64plus.so.2.0.0 out/libmupen64plus.so.2.0.0
ln -sf libmupen64plus.so.2.0.0 out/libmupen64plus.so.2
mupen64plus: out
+make -C ../mupen64plus-ui-console/projects/unix $(MAKE_OPTS) all
cp ../mupen64plus-ui-console/projects/unix/mupen64plus out/$@
video-gles2n64: out
+make -C ../mupen64plus-video-gles2n64/projects/unix $(MAKE_OPTS) all
cp ../mupen64plus-video-gles2n64/projects/unix/mupen64plus-video-n64.so out/mupen64plus-video-n64.so
rsp-hle input-sdl audio-sdl: out
+make -C ../mupen64plus-$@/projects/unix $(MAKE_OPTS) all
cp ../mupen64plus-$@/projects/unix/mupen64plus-$@.so out/mupen64plus-$@.so
out:
cp -r ../mupen64plus-core/data $@
cp ../mupen64plus-video-gles2n64/gles2n64.conf $@/gles2n64.conf
cp ../mupen64plus-input-sdl/data/InputAutoCfg.ini $@/InputAutoCfg.ini
clean:
make -C ../mupen64plus-core/projects/unix $(MAKE_OPTS) clean
make -C ../mupen64plus-input-sdl/projects/unix $(MAKE_OPTS) clean
make -C ../mupen64plus-audio-sdl/projects/unix $(MAKE_OPTS) clean
make -C ../mupen64plus-rsp-hle/projects/unix $(MAKE_OPTS) clean
make -C ../mupen64plus-ui-console/projects/unix $(MAKE_OPTS) clean
make -C ../mupen64plus-video-gles2n64/projects/unix $(MAKE_OPTS) clean
rm -rf out