xwords/xwords4/wasm/Makefile

64 lines
1.6 KiB
Makefile
Raw Normal View History

2021-02-01 17:30:34 +01:00
2021-02-02 05:13:25 +01:00
include ../common/config.mk
2021-02-01 17:30:34 +01:00
2021-02-06 17:52:42 +01:00
DEBS = cmake
2021-02-02 05:13:25 +01:00
INPUTS = main.c wasmdict.c wasmutls.c wasmdraw.c wasmutil.c wasmdutil.c ${COMMONSRC}
DEFINES += -DMEM_DEBUG -DDEBUG
DEFINES += -DXWFEATURE_CHAT
DEFINES += -DXWFEATURE_BONUSALL
DEFINES += -DMAX_ROWS=32
DEFINES += -DCOMMON_LAYOUT
DEFINES += -DDROP_BITMAPS
DEFINES += -D__LITTLE_ENDIAN
DEFINES += -DXWFEATURE_RELAY
DEFINES += -DXWFEATURE_DEVID
DEFINES += -D__WORDSIZE=32
DEFINES += -DCOMMS_CHECKSUM
DEFINES += -DENABLE_LOGGING
DEFINES += -DKEYBOARD_NAV
DEFINES += -DDISABLE_TILE_SEL
DEFINES += -DKEY_SUPPORT
DEFINES += -DSTREAM_VERS_HASHSTREAM
DEFINES += -DXWFEATURE_KNOWNPLAYERS
DEFINES += -DXWFEATURE_DICTSANITY
DEFINES += -DPOINTER_SUPPORT
2021-02-03 17:47:23 +01:00
DEFINES += -DPLATFORM_WASM
2021-02-03 21:53:03 +01:00
DEFINES += -DXWFEATURE_CROSSHAIRS
2021-02-01 17:30:34 +01:00
2021-02-03 20:47:03 +01:00
OUTPUTS = main.html main.js main.js.mem main.data main.html.mem
2021-02-01 17:30:34 +01:00
2021-02-03 05:58:43 +01:00
all: main.js
# PHONY: upload
2021-02-03 05:58:43 +01:00
main.js: ${INPUTS} Makefile
2021-02-03 20:47:03 +01:00
emcc $(DEFINES) -O2 -DNAKED_MODE=1 -I . -I ../common -I ../relay -s USE_SDL=2 \
2021-02-03 05:58:43 +01:00
--preload-file assets_dir --memory-init-file 1 \
2021-02-02 18:08:41 +01:00
-s USE_SDL_TTF=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' \
2021-02-04 00:37:50 +01:00
-s EXPORTED_FUNCTIONS='["_mainf", "_button", "_newgame"]' -s WASM=0 \
2021-02-03 05:58:43 +01:00
-s "EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']" \
2021-02-02 18:08:41 +01:00
${INPUTS} -o $@
2021-02-03 20:47:03 +01:00
main.html: ${INPUTS} Makefile
emcc $(DEFINES) -I . -I ../common -I ../relay -s USE_SDL=2 \
--preload-file assets_dir \
-s USE_SDL_TTF=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='["png"]' \
-s WASM=0 \
${INPUTS} -o $@
2021-02-06 17:52:42 +01:00
upload:
if [ -n "${XW_WASM_DEST}" ]; then \
2021-02-06 18:23:39 +01:00
for FILE in ${OUTPUTS}; do \
[ -f $$FILE ] && scp $$FILE ${XW_WASM_DEST}; \
echo "$$FILE copied"; \
done; \
2021-02-06 17:52:42 +01:00
fi
2021-02-03 20:47:03 +01:00
clean:
2021-02-06 18:23:39 +01:00
rm -f ${OUTPUTS}
2021-02-06 17:52:42 +01:00
debs_install:
sudo apt-get install ${DEBS}