examples: add aot target
This commit is contained in:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user