Files
fail-wasm/wasm-base/examples/Makefile

34 lines
653 B
Makefile

WAMRC := /opt/wamr-wamrc/wamrc
IWASM := /opt/wamr-iwasm/iwasm
WASI_SDK := /opt/wasi-sdk
SYSROOT := $(WASI_SDK)/share/wasi-sysroot
CLANG := $(WASI_SDK)/bin/clang
CFLAGS := --target=wasm32-wasi \
--sysroot=$(SYSROOT) \
-O2
SRCS := $(wildcard *.c)
WASMS := $(SRCS:.c=.wasm)
AOTS := $(WASMS:.wasm=.aot)
.PHONY: build-all build-wasms build-aots clean
build-all: build-wasms build-aots
# Compile to wasm bytecode using wasi-sdk
build-wasms: $(WASMS)
%.wasm: %.c
$(CLANG) $(CFLAGS) $< -o $@
# Compile ahead-of-time module using wamrc
build-aots: $(AOTS)
%.aot: %.wasm
$(WAMRC) -o $@ $<
clean:
rm -f *.wasm
rm -f *.aot