summaryrefslogtreecommitdiffhomepage
path: root/webassembly
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2023-01-28 15:07:14 +0100
committerRoland Reichwein <mail@reichwein.it>2023-01-28 15:07:14 +0100
commita61c702d91d7444ce0bb094ddccc70f72416500b (patch)
tree8d5a47c73666ee2b710a7a34c0c392b728bda45b /webassembly
parentf44d36b05e43cabde31aeaba5d25fded140345a1 (diff)
Added WebAssembly for C++ implementation of Diff
Diffstat (limited to 'webassembly')
-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