Add native/build_native.py to auto-discover WABT's wasm2c runtime headers and sources (wasm-rt.h, wasm-rt-*.c, and .inc files, with WASM2C_RUNTIME_DIR override) and OpenSSL flags across Linux distros and macOS, instead of assuming /usr/include/wasm-rt.h and -lwasm-rt-impl. Guard _DARWIN_C_SOURCE vs _POSIX_C_SOURCE in native/wasi_host.c, delegate just native to native/build_native.py, and document WASM2C_RUNTIME_DIR in README.md.
27 lines
508 B
Makefile
27 lines
508 B
Makefile
set positional-arguments
|
|
|
|
default:
|
|
@just --list
|
|
|
|
build:
|
|
wasm-tools parse curl.wat -o curl.wasm
|
|
wasm-tools validate curl.wasm --features component-model
|
|
|
|
native: build
|
|
python3 native/build_native.py
|
|
|
|
test: build
|
|
python3 tests/test_curl.py
|
|
|
|
test-native: native
|
|
CURL_WASM_NATIVE=./curl-native python3 tests/test_curl.py
|
|
|
|
run *args: build
|
|
wasmtime run -S http --dir=. -- ./curl.wasm "$@"
|
|
|
|
run-native *args: native
|
|
./curl-native "$@"
|
|
|
|
clean:
|
|
rm -rf curl.wasm curl-native build
|