From b018940c22a138a42ea00a6a701c598c5c9cdda7 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 19 Jan 2026 14:26:50 +0100 Subject: [PATCH] examples: add aot target --- wasm-base/examples/Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/wasm-base/examples/Makefile b/wasm-base/examples/Makefile index ba63856..ff9af99 100644 --- a/wasm-base/examples/Makefile +++ b/wasm-base/examples/Makefile @@ -1,20 +1,31 @@ -WASI_SDK := /opt/wasi-sdk -CLANG := $(WASI_SDK)/bin/clang -SYSROOT := $(WASI_SDK)/share/wasi-sysroot +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-examples clean +.PHONY: build-all build-wasms build-aots clean -build-examples: $(WASMS) +build-all: build-wasms build-aots + +build-wasms: $(WASMS) %.wasm: %.c $(CLANG) $(CFLAGS) $< -o $@ +build-aots: $(AOTS) + +%.aot: %.wasm + $(WAMRC) -o $@ $< + clean: rm -f *.wasm + rm -f *.aot