-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
47 lines (34 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
LLVM_HOME=/home/danielbevenius/work/wasm/wasi-sdk-14.0
LLVM_BIN=${LLVM_HOME}/bin
WASI_SYSROOT=${LLVM_HOME}/share/wasi-sysroot
WASMTIME=~/work/wasm/wasmtime/target/debug/wasmtime
TRIPLE=wasm32-wasi
out/first.wasm: src/first.c | out
${LLVM_BIN}/clang --target=${TRIPLE} --sysroot ${WASI_SYSROOT} -O2 -s -o out/first.wasm $<
out/firstcxx.wasm: src/first.cc | out
${LLVM_BIN}/clang++ -v -std=c++11 --target=${TRIPLE} --sysroot ${WASI_SYSROOT} -O2 -s -o out/firstcxx.wasm $<
out/readdir.wasm: src/readdir.c | out
${LLVM_BIN}/clang --target=${TRIPLE} --sysroot ${WASI_SYSROOT} -g -O0 -s -o $@ $<
out/readdir.llvm: src/readdir.c | out
${LLVM_BIN}/clang -S -emit-llvm --target=${TRIPLE} --sysroot ${WASI_SYSROOT} -O0 -o $@ $<
out/readdir: src/readdir.c | out
${CC} -O0 -g -s -o $@ $<
out/readdir_s: src/readdir.c | out
${CC} -O0 -g -s -static -Xlinker -Map=readdir_s.map -o $@ $<
out/%.wasm: src/%.wat | out
wat2wasm -v -o $@ $< --debug-names
out:
@mkdir $@
.PHONY: run
run:
RUST_BACKTRACE=1 ${WASMTIME} out/first.wasm
.PHONY: fd_write
fd_write:
@${WASMTIME} src/[email protected]
.PHONY: args_sizes_get
args_sizes_get:
@${WASMSTIME} src/[email protected] arg1 arg2 arg3
@echo "status:$?"
.PHONY: clean
clean:
@${RM} -rf out