summaryrefslogtreecommitdiffhomepage
path: root/webassembly/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'webassembly/Makefile')
-rw-r--r--webassembly/Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/webassembly/Makefile b/webassembly/Makefile
new file mode 100644
index 0000000..eeaa357
--- /dev/null
+++ b/webassembly/Makefile
@@ -0,0 +1,20 @@
+TARGET=libwhiteboard.wasm
+TARGETJS=$(TARGET:.wasm=.js)
+
+OBJS=diff.o
+
+CXX=em++
+
+CXXFLAGS=-I/usr/include
+LDFLAGS=-s WASM=1 -s LINKABLE=1 -s EXPORT_ALL=1
+default: $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(CXX) $(LDFLAGS) $(OBJS) -o $(TARGETJS)
+ cp $(TARGETJS) $(TARGET) ../html/
+
+diff.o: ../diff.cpp
+ $(CXX) -c $< $(CXXFLAGS) -o $@
+
+clean:
+ -rm -f *.o *.js *.wasm *.html