mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
46 lines
1.5 KiB
Makefile
46 lines
1.5 KiB
Makefile
# -*- Makefile -*-
|
|
|
|
EMPORTS := -s USE_ZLIB=1 -s USE_FREETYPE=1 -s USE_SDL=2
|
|
EMFLAGS := -s ENVIRONMENT=web $(EMPORTS)
|
|
|
|
#EMFLAGS += -O1 -s ASSERTIONS=1
|
|
EMFLAGS += -Oz
|
|
|
|
EMFLAGS += -s EMTERPRETIFY=1 -s EMTERPRETIFY_ASYNC=1
|
|
EMFLAGS += -s ALLOW_MEMORY_GROWTH=1
|
|
EMFLAGS += -s NO_EXIT_RUNTIME=1
|
|
|
|
LFLAGS := $(EMFLAGS)
|
|
LFLAGS += -s EXPORTED_FUNCTIONS="['_main','_ags_setAntialiasedStringMode', '_ald_getdata', '_ald_freedata', '_va_alarm_handler']"
|
|
LFLAGS += -s EXTRA_EXPORTED_RUNTIME_METHODS="['getValue','getMemory','addRunDependency','removeRunDependency']"
|
|
|
|
JSLIB := --js-library emscripten/library.js
|
|
|
|
SYNCLIST := -s EMTERPRETIFY_SYNCLIST="['_muspcm_load_no','_muspcm_load_mixlr','_muspcm_waitend','_wait_vsync','_load_mincho_font']"
|
|
|
|
WASMFLAGS := -s WASM=1 -s "BINARYEN_TRAP_MODE='allow'"
|
|
ASMJSFLAGS := -s WASM=0
|
|
|
|
all: out/xsystem35.js out/xsystem35.asm.js
|
|
|
|
out:
|
|
mkdir out
|
|
|
|
out/xsystem35.js: emterpretify_whitelist src/xsystem35 out
|
|
$(CC) xsystem35.bc $(LFLAGS) $(JSLIB) $(WASMFLAGS) @emterpretify_whitelist -o $@
|
|
|
|
out/xsystem35.asm.js: emterpretify_whitelist src/xsystem35 out
|
|
$(CC) xsystem35.bc $(LFLAGS) $(JSLIB) $(ASMJSFLAGS) @emterpretify_whitelist -o $@
|
|
|
|
emterpretify_whitelist:
|
|
$(CC) $(EMPORTS) -s EMTERPRETIFY=1 -s EMTERPRETIFY_ADVISE=1 $(SYNCLIST) $(JSLIB) xsystem35.bc |grep EMTERPRETIFY_WHITELIST > $@
|
|
|
|
src/xsystem35: src src/Makefile
|
|
$(MAKE) -C src
|
|
ln -sf src/xsystem35 xsystem35.bc
|
|
|
|
src/Makefile:
|
|
emconfigure ./configure --disable-shared --enable-gtk=no --enable-sdl --enable-cdrom=emscripten CFLAGS='-Oz -s USE_ZLIB=1' FT2_CONFIG=tools/freetype-config
|
|
|
|
.PHONY: src
|