RetroArch/Makefile.emscripten

120 lines
3.0 KiB
Makefile
Raw Normal View History

TARGET = retroarch.js
2014-09-14 03:38:36 +02:00
OS = Emscripten
OBJ :=
2015-04-20 21:10:01 +02:00
DEFINES := -DRARCH_INTERNAL -DHAVE_OVERLAY -DHAVE_MAIN
2015-04-19 13:58:44 -05:00
DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL -DHAVE_OVERLAY -DHAVE_GLSL -DHAVE_FILTERS_BUILTIN
2015-11-20 17:41:50 +01:00
HAVE_EGL = 1
HAVE_OPENGL = 1
2014-12-31 20:26:22 -06:00
HAVE_GLES = 1
2014-09-14 03:22:04 +02:00
HAVE_EMSCRIPTEN = 1
HAVE_RGUI = 1
HAVE_SDL = 0
HAVE_ZLIB = 1
HAVE_FBO = 1
2015-03-14 05:24:57 +01:00
WANT_ZLIB = 1
2014-12-31 20:26:22 -06:00
MEMORY = 268435456
LTO = 0
2013-12-29 16:19:07 -05:00
# XXX: setting this to 1/2 currently crashes Firefox nightly
PRECISE_F32 = 2
ifneq ($(NATIVE_ZLIB),)
2015-03-14 05:24:57 +01:00
WANT_ZLIB = 0
endif
2014-09-14 02:52:30 +02:00
LIBS :=
2015-08-20 00:57:54 +02:00
LDFLAGS := -L. --no-heap-copy -s USE_ZLIB=1 -s TOTAL_MEMORY=$(MEMORY) -s OUTLINING_LIMIT=50000 \
-s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_load_state', '_cmd_take_screenshot']" \
--js-library emscripten/library_rwebaudio.js \
--js-library emscripten/library_rwebinput.js \
--js-library emscripten/library_rwebcam.js
2014-09-14 00:55:17 +02:00
2014-09-14 00:11:08 +02:00
include Makefile.common
2015-04-19 13:58:44 -05:00
OBJ += gfx/video_filters/2xsai.o
OBJ += gfx/video_filters/super2xsai.o
OBJ += gfx/video_filters/supereagle.o
OBJ += gfx/video_filters/2xbr.o
OBJ += gfx/video_filters/darken.o
OBJ += gfx/video_filters/epx.o
OBJ += gfx/video_filters/scale2x.o
OBJ += gfx/video_filters/blargg_ntsc_snes.o
OBJ += gfx/video_filters/lq2x.o
OBJ += gfx/video_filters/phosphor2x.o
OBJ += audio/audio_filters/echo.o
OBJ += audio/audio_filters/eq.o
OBJ += audio/audio_filters/chorus.o
OBJ += audio/audio_filters/iir.o
OBJ += audio/audio_filters/panning.o
OBJ += audio/audio_filters/phaser.o
OBJ += audio/audio_filters/reverb.o
OBJ += audio/audio_filters/wahwah.o
CFLAGS += -Ideps/zlib/
libretro = libretro_emscripten.bc
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)
2013-12-29 16:19:07 -05:00
LDFLAGS += -s PRECISE_F32=$(PRECISE_F32)
ifeq ($(LTO), 1)
LDFLAGS += --llvm-lto 3
endif
CFLAGS += -O2
endif
CFLAGS += -DWANT_RPNG -Wall -Wno-unused-result -Wno-unused-variable -I. -Ilibretro-common/include -std=gnu99 -s USE_ZLIB=1 \
-s EXPORTED_FUNCTIONS="['_main', '_malloc', '_cmd_savefiles', '_cmd_save_state', '_cmd_take_screenshot']"
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
2015-03-06 01:47:09 +01:00
rm -f deps/zlib/*.o
rm -f frontend/*.o
2014-10-28 19:54:23 +01:00
rm -f menu/*.o
rm -f menu/disp/*.o
rm -f audio/*.o
rm -f compat/*.o
rm -f compat/rxml/*.o
rm -f conf/*.o
rm -f gfx/scaler/*.o
rm -f gfx/*.o
2014-09-14 06:45:47 +02:00
rm -f gfx/d3d/*.o
2015-01-12 22:19:31 +01:00
rm -f gfx/drivers_context/*.o
rm -f gfx/math/*.o
2015-01-12 23:38:21 +01:00
rm -f gfx/drivers_font/*.o
rm -f gfx/drivers_font_renderer/*.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 libretro-common/*/*.o
2013-08-07 18:37:05 -04:00
rm -f $(TARGET)
rm -f *.d
.PHONY: all clean