From 4904aa341be9c74dec28e6eeea79b707211f2f06 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 26 Oct 2023 22:43:46 +0100 Subject: Add a basic C based wasmtime runtime This can be used for creating an equivalent rust based runtime with C bindings. Signed-off-by: Andrew Clayton --- c/wasmtime-basic/Makefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 c/wasmtime-basic/Makefile (limited to 'c/wasmtime-basic/Makefile') diff --git a/c/wasmtime-basic/Makefile b/c/wasmtime-basic/Makefile new file mode 100644 index 0000000..ad70fce --- /dev/null +++ b/c/wasmtime-basic/Makefile @@ -0,0 +1,17 @@ +CC = gcc +CFLAGS = -Wall -Wextra -g -I$(WASMTIME_C_API)/include -L$(WASMTIME_C_API)/lib +LDFLAGS = -Wl,-rpath,$(WASMTIME_C_API)/lib + +WASM_CC = clang +WASM_CFLAGS = -Wall -Wextra -fno-strict-aliasing --target=wasm32-wasi --sysroot=$(WASI_SYSROOT) + +all: wasmtime test.wasm + +wasmtime: wasmtime.c + $(CC) $(CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ $< -lwasmtime + +test.wasm: test.c + $(WASM_CC) $(WASM_CFLAGS) -o $@ $< + +clean: + rm -f wasmtime test.wasm -- cgit