examples: wamr example program
This commit is contained in:
20
wasm-base/examples/Makefile
Normal file
20
wasm-base/examples/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
WASI_SDK := /opt/wasi-sdk
|
||||
CLANG := $(WASI_SDK)/bin/clang
|
||||
SYSROOT := $(WASI_SDK)/share/wasi-sysroot
|
||||
|
||||
CFLAGS := --target=wasm32-wasi \
|
||||
--sysroot=$(SYSROOT) \
|
||||
-O2
|
||||
|
||||
SRCS := $(wildcard *.c)
|
||||
WASMS := $(SRCS:.c=.wasm)
|
||||
|
||||
.PHONY: build-examples clean
|
||||
|
||||
build-examples: $(WASMS)
|
||||
|
||||
%.wasm: %.c
|
||||
$(CLANG) $(CFLAGS) $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f *.wasm
|
||||
Reference in New Issue
Block a user