2013-07-19 03:58:35 +00:00
|
|
|
TARGET = retroarch.js
|
2013-07-18 00:26:01 +00:00
|
|
|
|
2014-09-14 01:38:36 +00:00
|
|
|
OS = Emscripten
|
2014-09-13 22:04:42 +00:00
|
|
|
OBJ :=
|
2014-09-24 07:39:41 +00:00
|
|
|
DEFINES := -DRARCH_INTERNAL -DHAVE_OVERLAY
|
2014-09-14 01:44:54 +00:00
|
|
|
DEFINES += -DHAVE_OPENGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DHAVE_EGL -DHAVE_OVERLAY -DHAVE_GLSL
|
2013-07-18 00:26:01 +00:00
|
|
|
|
|
|
|
HAVE_OPENGL = 1
|
2015-01-01 02:26:22 +00:00
|
|
|
HAVE_GLES = 1
|
2014-09-14 01:22:04 +00:00
|
|
|
HAVE_EMSCRIPTEN = 1
|
2013-07-18 00:26:01 +00:00
|
|
|
HAVE_RGUI = 1
|
2013-09-11 00:21:48 +00:00
|
|
|
HAVE_SDL = 0
|
2013-07-18 00:26:01 +00:00
|
|
|
HAVE_ZLIB = 1
|
|
|
|
HAVE_FBO = 1
|
2013-07-19 03:58:35 +00:00
|
|
|
WANT_MINIZ = 1
|
2015-01-01 02:26:22 +00:00
|
|
|
MEMORY = 268435456
|
2013-08-18 06:50:10 +00:00
|
|
|
LTO = 0
|
2013-12-29 21:19:07 +00:00
|
|
|
# XXX: setting this to 1/2 currently crashes Firefox nightly
|
2014-07-07 00:02:44 +00:00
|
|
|
PRECISE_F32 = 2
|
2013-07-18 00:26:01 +00:00
|
|
|
|
2013-07-27 18:17:22 +00:00
|
|
|
ifneq ($(NATIVE_ZLIB),)
|
|
|
|
WANT_MINIZ = 0
|
|
|
|
endif
|
|
|
|
|
2014-09-14 00:52:30 +00:00
|
|
|
LIBS :=
|
2014-09-13 22:55:17 +00:00
|
|
|
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
|
|
|
|
|
2014-09-13 22:11:08 +00:00
|
|
|
include Makefile.common
|
|
|
|
|
2013-08-18 06:50:10 +00:00
|
|
|
libretro = libretro_emscripten.bc
|
2013-07-18 00:26:01 +00:00
|
|
|
|
|
|
|
ifneq ($(V), 1)
|
|
|
|
Q := @
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(DEBUG), 1)
|
2013-07-27 18:17:22 +00:00
|
|
|
LDFLAGS += -O0 -g
|
2013-08-18 06:50:10 +00:00
|
|
|
CFLAGS += -O0 -g
|
2013-07-18 00:26:01 +00:00
|
|
|
else
|
2013-08-18 06:50:10 +00:00
|
|
|
LDFLAGS += -O2
|
|
|
|
# WARNING: some optimizations can break some cores (ex: LTO breaks tyrquake)
|
2013-12-29 21:19:07 +00:00
|
|
|
LDFLAGS += -s PRECISE_F32=$(PRECISE_F32)
|
2013-08-18 06:50:10 +00:00
|
|
|
ifeq ($(LTO), 1)
|
|
|
|
LDFLAGS += --llvm-lto 3
|
|
|
|
endif
|
|
|
|
CFLAGS += -O2
|
2013-07-18 00:26:01 +00:00
|
|
|
endif
|
|
|
|
|
2014-10-24 16:44:57 +00:00
|
|
|
CFLAGS += -Wall -Wno-unused-result -Wno-unused-variable -I. -Ilibretro-sdk/include -std=gnu99
|
2013-07-18 00:26:01 +00:00
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
$(TARGET): $(OBJ)
|
|
|
|
@$(if $(Q), $(shell echo echo LD $@),)
|
2013-08-18 06:50:10 +00:00
|
|
|
$(Q)$(LD) -o $@ $(OBJ) $(libretro) $(LIBS) $(LDFLAGS)
|
2013-07-18 00:26:01 +00:00
|
|
|
|
|
|
|
%.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
|
2014-09-13 23:58:57 +00:00
|
|
|
rm -f deps/rzlib/*.o
|
2013-07-18 00:26:01 +00:00
|
|
|
rm -f frontend/*.o
|
2014-10-28 18:54:23 +00:00
|
|
|
rm -f menu/*.o
|
|
|
|
rm -f menu/disp/*.o
|
2013-07-18 00:26:01 +00:00
|
|
|
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
|
2014-09-14 04:45:47 +00:00
|
|
|
rm -f gfx/d3d/*.o
|
2013-07-18 00:26:01 +00:00
|
|
|
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
|
2013-08-28 04:03:25 +00:00
|
|
|
rm -f gfx/glsym/*.o
|
2013-07-18 00:26:01 +00:00
|
|
|
rm -f record/*.o
|
|
|
|
rm -f input/*.o
|
|
|
|
rm -f tools/*.o
|
2015-01-01 02:26:22 +00:00
|
|
|
rm -f libretro-sdk/*/*.o
|
2013-08-07 22:37:05 +00:00
|
|
|
rm -f $(TARGET)
|
2014-11-18 15:01:36 +00:00
|
|
|
rm -f *.d
|
2013-07-18 00:26:01 +00:00
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|