examples: add aot target
This commit is contained in:
@ -1,20 +1,31 @@
|
|||||||
WASI_SDK := /opt/wasi-sdk
|
WAMRC := /opt/wamr-wamrc/wamrc
|
||||||
CLANG := $(WASI_SDK)/bin/clang
|
IWASM := /opt/wamr-iwasm/iwasm
|
||||||
SYSROOT := $(WASI_SDK)/share/wasi-sysroot
|
|
||||||
|
|
||||||
|
WASI_SDK := /opt/wasi-sdk
|
||||||
|
SYSROOT := $(WASI_SDK)/share/wasi-sysroot
|
||||||
|
CLANG := $(WASI_SDK)/bin/clang
|
||||||
CFLAGS := --target=wasm32-wasi \
|
CFLAGS := --target=wasm32-wasi \
|
||||||
--sysroot=$(SYSROOT) \
|
--sysroot=$(SYSROOT) \
|
||||||
-O2
|
-O2
|
||||||
|
|
||||||
SRCS := $(wildcard *.c)
|
SRCS := $(wildcard *.c)
|
||||||
WASMS := $(SRCS:.c=.wasm)
|
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
|
%.wasm: %.c
|
||||||
$(CLANG) $(CFLAGS) $< -o $@
|
$(CLANG) $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
|
build-aots: $(AOTS)
|
||||||
|
|
||||||
|
%.aot: %.wasm
|
||||||
|
$(WAMRC) -o $@ $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f *.wasm
|
rm -f *.wasm
|
||||||
|
rm -f *.aot
|
||||||
|
|||||||
Reference in New Issue
Block a user