commit 7950ed52913d0e099c9fe87b6f96632bed2aed3c
parent 0cde66af19af8a00f4763d0b697364238397e34e
Author: William Casarin <jb55@jb55.com>
Date: Mon, 30 Nov 2020 09:59:59 -0800
make: add wasms
Diffstat:
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
@@ -13,8 +13,13 @@ OBJS = src/io.o \
src/parser.o \
src/wasm.o
+WASMS = wasm/hello-c.wasm \
+ wasm/hello.wasm
+
all: protoverse libprotoverse.a
+wasm: $(WASMS)
+
%.o: %.c %.h
@echo "cc $<"
@$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<
@@ -22,6 +27,9 @@ all: protoverse libprotoverse.a
%.wasm: %.wat
wat2wasm $^ -o $@
+wasm/hello-c.wasm: wasm/hello-c.c
+ emcc $< -s WASM=1 -o $@
+
protoverse: src/protoverse.c $(OBJS)
@echo "ld $@"
@$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@
@@ -30,7 +38,7 @@ libprotoverse.a: $(OBJS)
ar rcs $@ $^
clean:
- rm -f protoverse test $(OBJS) libprotoverse.a
+ rm -f protoverse test $(OBJS) libprotoverse.a $(WASMS)
test: src/test.c $(OBJS)
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $@