summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile23
1 files changed, 17 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 02714d0..5835dda 100644
--- a/Makefile
+++ b/Makefile
@@ -5,20 +5,31 @@ ASSETS_DST = $(patsubst game/www/%,dist/%,$(ASSETS_SRC))
TEST_PORT ?= 8000
-IMAGE := dungeon_crawl_builder
+EMCC_CFLAGS := -O3 \
+ -sUSE_GLFW=3 \
+ -sASSERTIONS=1 \
+ -sWASM=1 \
+ -sASYNCIFY \
+ -sGL_ENABLE_GET_PROC_ADDRESS=1 \
+ -sEXPORTED_RUNTIME_METHODS=HEAPF32,ccall,cwrap
web: dist $(ASSETS_DST)
test: web
cd dist && python3 -m http.server $(TEST_PORT)
-image:
- docker build -t $(IMAGE) .
-
dist:
- docker run --rm -it -v .:/data -v ~/.cargo:/home/builder/.cargo $(IMAGE)
+ env \
+ CC=emcc \
+ CXX=em++ \
+ AR=emar \
+ CFLAGS="$(EMCC_CFLAGS)" \
+ CXXFLAGS="$(EMCC_CFLAGS)" \
+ EMCC_CFLAGS="$(EMCC_CFLAGS)" \
+ CMAKE_INSTALL_LIBDIR=lib \
+ cargo build --target wasm32-unknown-emscripten --profile wasm
mkdir -p dist
- cp ./target/wasm32-unknown-emscripten/release/game.{js,wasm} dist
+ cp ./target/wasm32-unknown-emscripten/wasm/game.{js,wasm} dist
dist/%: game/www/%
cp -r $< $@