summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-02 05:58:26 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2022-05-02 05:58:26 -0700
commit6a4dd8790c5c98466087a5374611f72131eff958 (patch)
treea40a8fe0ef8833e2c758d6b67fda640fa6d28b01
parent446a32d0e301285e54fa1030fb2138b0169d3fae (diff)
downloaddartboat-6a4dd8790c5c98466087a5374611f72131eff958.tar.gz
dartboat-6a4dd8790c5c98466087a5374611f72131eff958.tar.xz
web: generate all required files in new dir
-rw-r--r--web/.gitignore1
-rw-r--r--web/Makefile8
-rw-r--r--web/web_main.c (renamed from web/dartboat_wasm.c)0
3 files changed, 6 insertions, 3 deletions
diff --git a/web/.gitignore b/web/.gitignore
new file mode 100644
index 0000000..6166a4e
--- /dev/null
+++ b/web/.gitignore
@@ -0,0 +1 @@
+dartboat_web
diff --git a/web/Makefile b/web/Makefile
index bdddb14..66d88f7 100644
--- a/web/Makefile
+++ b/web/Makefile
@@ -6,16 +6,18 @@ CFLAGS += -O3 -Wall -Wextra -Wno-unknown-warning-option -I../ \
-sEXPORTED_FUNCTIONS=_main,_malloc,_free \
-sEXPORTED_RUNTIME_METHODS=UTF8ToString,stringToUTF8,lengthBytesUTF8
-TARGET := static/dartboat_wasm.js
+TARGET := dartboat_web
SRC := $(wildcard *.c) ../comp.c ../match.c ../board.c ../checkouts.c
all: $(TARGET)
$(TARGET): $(SRC)
- $(CC) $(CFLAGS) $^ -o $@
+ mkdir $(TARGET)
+ $(CC) $(CFLAGS) $^ -o $(TARGET)/dartboat_wasm.js
+ cp static/* $(TARGET)/
clean:
- rm -f $(TARGET) $(TARGET:.js=.wasm)
+ rm -rf $(TARGET)
.PHONY: all clean
diff --git a/web/dartboat_wasm.c b/web/web_main.c
index 42535aa..42535aa 100644
--- a/web/dartboat_wasm.c
+++ b/web/web_main.c