forked from libretro/RetroArch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.emscripten
171 lines (150 loc) · 4.23 KB
/
Makefile.emscripten
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
TARGET = retroarch.js
OBJ = frontend/platform/platform_emscripten.o \
frontend/platform/platform_null.o \
frontend/frontend.o \
frontend/menu/menu_input_line_cb.o \
retroarch.o \
file.o \
file_path.o \
driver.o \
conf/config_file.o \
settings.o \
settings_data.o \
hash.o \
dynamic.o \
dynamic_dummy.o \
message_queue.o \
rewind.o \
movie.o \
gfx/gfx_common.o \
input/input_common.o \
input/rwebinput_input.o \
input/keyboard_line.o \
core_options.o \
patch.o \
compat/compat.o \
compat/rxml/rxml.o \
screenshot.o \
cheats.o \
audio/utils.o \
audio/rwebaudio.o \
audio/dsp_filter.o \
input/overlay.o \
fifo_buffer.o \
gfx/scaler/scaler.o \
gfx/shader_common.o \
gfx/scaler/pixconv.o \
gfx/scaler/scaler_int.o \
gfx/scaler/scaler_filter.o \
gfx/state_tracker.o \
gfx/shader_parse.o \
gfx/fonts/fonts.o \
gfx/fonts/bitmapfont.o \
gfx/image/image_rpng.o \
gfx/filter.o \
audio/resampler.o \
audio/sinc.o \
audio/cc_resampler.o \
audio/null.o \
performance.o \
frontend/info/core_info.o \
camera/rwebcam.o
HAVE_OPENGL = 1
HAVE_RGUI = 1
HAVE_SDL = 0
HAVE_ZLIB = 1
HAVE_FBO = 1
WANT_MINIZ = 1
MEMORY = 67108864
LTO = 0
# XXX: setting this to 1/2 currently crashes Firefox nightly
PRECISE_F32 = 0
ifneq ($(NATIVE_ZLIB),)
WANT_MINIZ = 0
endif
libretro = libretro_emscripten.bc
LIBS =
DEFINES = -DHAVE_SCREENSHOTS -DHAVE_CAMERA -DHAVE_NULLAUDIO -DHAVE_BSV_MOVIE -DRARCH_INTERNAL -DHAVE_CC_RESAMPLER
LDFLAGS = -L. -s TOTAL_MEMORY=$(MEMORY) -s OUTLINING_LIMIT=50000 --js-library emscripten/library_rwebaudio.js --js-library emscripten/library_rwebinput.js --js-library emscripten/library_rwebcam.js --no-heap-copy
ifeq ($(HAVE_RGUI), 1)
DEFINES += -DHAVE_MENU -DHAVE_RGUI
OBJ += frontend/menu/disp/rgui.o
HAVE_MENU_COMMON = 1
endif
ifeq ($(HAVE_MENU_COMMON), 1)
OBJ += frontend/menu/backend/menu_common_backend.o frontend/menu/menu_input_line_cb.o frontend/menu/menu_common.o frontend/menu/menu_navigation.o frontend/menu/file_list.o frontend/menu/history.o
endif
ifeq ($(HAVE_SDL), 1)
OBJ += input/sdl_input.o
LIBS += -lSDL
DEFINES += -ISDL -DHAVE_SDL
endif
ifeq ($(HAVE_OPENGL), 1)
OBJ += gfx/gl.o gfx/math/matrix.o gfx/fonts/gl_font.o gfx/fonts/gl_raster_font.o gfx/gfx_context.o gfx/context/emscriptenegl_ctx.o gfx/shader_glsl.o gfx/glsym/rglgen.o gfx/glsym/glsym_es2.o
DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL -DHAVE_OVERLAY -DHAVE_GLSL
endif
ifeq ($(HAVE_ZLIB), 1)
OBJ += gfx/rpng/rpng.o file_extract.o
DEFINES += -DHAVE_ZLIB
ifeq ($(WANT_MINIZ), 1)
OBJ += deps/rzlib/adler32.o deps/rzlib/compress.o deps/rzlib/crc32.o deps/rzlib/deflate.o deps/rzlib/gzclose.o deps/rzlib/gzlib.o deps/rzlib/gzread.o deps/rzlib/gzwrite.o deps/rzlib/inffast.o deps/rzlib/inflate.o deps/rzlib/inftrees.o deps/rzlib/trees.o deps/rzlib/uncompr.o deps/rzlib/zutil.o deps/rzlib/ioapi.o deps/rzlib/unzip.o
DEFINES += -DWANT_MINIZ
else
LIBS += -lz
DEFINES += -DHAVE_ZLIB_DEFLATE
endif
endif
ifeq ($(HAVE_FBO), 1)
DEFINES += -DHAVE_FBO
endif
ifneq ($(V), 1)
Q := @
endif
ifeq ($(DEBUG), 1)
LDFLAGS += -O0 -g
CFLAGS += -O0 -g
else
LDFLAGS += -O2
# WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake)
LDFLAGS += -s PRECISE_F32=$(PRECISE_F32)
ifeq ($(LTO), 1)
LDFLAGS += --llvm-lto 3
endif
CFLAGS += -O2
endif
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -std=gnu99
all: $(TARGET)
$(TARGET): $(OBJ)
@$(if $(Q), $(shell echo echo LD $@),)
$(Q)$(LD) -o $@ $(OBJ) $(libretro) $(LIBS) $(LDFLAGS)
%.o: %.c
@$(if $(Q), $(shell echo echo CC $<),)
$(Q)$(CC) $(CFLAGS) $(DEFINES) -c -o $@ $<
%.o: %.cpp
@$(if $(Q), $(shell echo echo CXX $<),)
$(Q)$(CXX) $(CXXFLAGS) $(DEFINES) -c -o $@ $<
clean:
rm -f *.o
rm -f deps/miniz/*.o
rm -f frontend/*.o
rm -f frontend/menu/*.o
rm -f frontend/menu/disp/*.o
rm -f audio/*.o
rm -f audio/xaudio-c/*.o
rm -f compat/*.o
rm -f compat/rxml/*.o
rm -f conf/*.o
rm -f gfx/scaler/*.o
rm -f gfx/*.o
rm -f gfx/d3d9/*.o
rm -f gfx/context/*.o
rm -f gfx/math/*.o
rm -f gfx/fonts/*.o
rm -f gfx/py_state/*.o
rm -f gfx/rpng/*.o
rm -f gfx/glsym/*.o
rm -f record/*.o
rm -f input/*.o
rm -f tools/*.o
rm -f $(TARGET)
.PHONY: all clean