2018-11-20 20:32:23 -08:00
|
|
|
ifeq (test, $(firstword $(MAKECMDGOALS)))
|
|
|
|
runargs := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
|
|
|
|
$(eval $(runargs):;@true)
|
|
|
|
endif
|
|
|
|
|
2018-12-15 00:45:03 -06:00
|
|
|
.PHONY: spectests emtests clean build install lint precommit
|
2018-10-23 23:54:07 +02:00
|
|
|
|
|
|
|
# This will re-generate the Rust test files based on spectests/*.wast
|
|
|
|
spectests:
|
2019-01-22 13:02:06 -06:00
|
|
|
WASMER_RUNTIME_GENERATE_SPECTESTS=1 cargo build -p wasmer-runtime-core
|
2018-10-23 23:54:07 +02:00
|
|
|
|
2018-12-09 19:21:28 -08:00
|
|
|
emtests:
|
2019-01-10 21:46:02 -08:00
|
|
|
WASM_EMSCRIPTEN_GENERATE_EMTESTS=1 cargo build -p wasmer-emscripten
|
2018-12-09 19:21:28 -08:00
|
|
|
|
2019-05-17 12:09:31 -07:00
|
|
|
wasitests:
|
|
|
|
WASM_WASI_GENERATE_WASITESTS=1 cargo build -p wasmer-wasi
|
|
|
|
|
2018-10-23 23:54:07 +02:00
|
|
|
# clean:
|
2018-11-13 10:28:50 -08:00
|
|
|
# rm -rf artifacts
|
2018-10-23 23:54:07 +02:00
|
|
|
|
|
|
|
build:
|
2019-02-26 15:39:54 -08:00
|
|
|
cargo build --features debug
|
2018-10-23 23:54:07 +02:00
|
|
|
|
|
|
|
install:
|
|
|
|
cargo install --path .
|
|
|
|
|
2019-01-18 12:20:13 -08:00
|
|
|
integration-tests: release
|
|
|
|
echo "Running Integration Tests"
|
2019-02-08 17:47:51 -08:00
|
|
|
./integration_tests/lua/test.sh
|
2019-02-08 10:55:32 -08:00
|
|
|
./integration_tests/nginx/test.sh
|
2019-04-22 17:06:42 -07:00
|
|
|
./integration_tests/cowsay/test.sh
|
2019-01-18 12:20:13 -08:00
|
|
|
|
2018-12-15 00:45:03 -06:00
|
|
|
lint:
|
2019-01-10 18:35:48 -06:00
|
|
|
cargo fmt --all -- --check
|
2019-03-26 10:27:07 -07:00
|
|
|
cargo +nightly-2019-02-27 clippy --all
|
2018-12-15 00:45:03 -06:00
|
|
|
|
|
|
|
precommit: lint test
|
|
|
|
|
2019-04-11 15:00:02 -07:00
|
|
|
build-install:
|
|
|
|
mkdir -p ./install/bin
|
2019-04-11 15:07:19 -07:00
|
|
|
cp ./wapm-cli/target/release/wapm ./install/bin/
|
2019-04-11 15:00:02 -07:00
|
|
|
cp ./target/release/wasmer ./install/bin/
|
|
|
|
tar -C ./install -zcvf wasmer.tar.gz bin/wapm bin/wasmer
|
|
|
|
|
|
|
|
# For installing the contents locally
|
|
|
|
do-install:
|
|
|
|
tar -C ~/.wasmer -zxvf wasmer.tar.gz
|
|
|
|
|
2018-10-23 23:54:07 +02:00
|
|
|
test:
|
2018-12-10 19:19:46 -08:00
|
|
|
# We use one thread so the emscripten stdouts doesn't collide
|
2019-04-11 12:44:03 -07:00
|
|
|
cargo test --all --exclude wasmer-runtime-c-api --exclude wasmer-emscripten --exclude wasmer-spectests --exclude wasmer-singlepass-backend -- $(runargs)
|
2019-01-18 10:11:14 -08:00
|
|
|
# cargo test --all --exclude wasmer-emscripten -- --test-threads=1 $(runargs)
|
2019-03-06 00:15:07 -06:00
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --features clif
|
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --features llvm
|
2019-05-14 18:19:58 -05:00
|
|
|
cargo test --manifest-path lib/runtime/Cargo.toml --features llvm
|
2019-02-03 13:21:59 -06:00
|
|
|
cargo build -p wasmer-runtime-c-api
|
2019-02-02 20:16:53 -06:00
|
|
|
cargo test -p wasmer-runtime-c-api -- --nocapture
|
2018-11-13 10:28:50 -08:00
|
|
|
|
2019-04-11 12:44:03 -07:00
|
|
|
test-singlepass:
|
|
|
|
cargo test --manifest-path lib/spectests/Cargo.toml --features singlepass
|
2019-05-14 18:19:58 -05:00
|
|
|
cargo test --manifest-path lib/runtime/Cargo.toml --features singlepass
|
2019-03-18 01:13:04 +08:00
|
|
|
|
2019-04-11 11:44:07 -07:00
|
|
|
test-emscripten-llvm:
|
2019-03-06 23:58:07 -06:00
|
|
|
cargo test --manifest-path lib/emscripten/Cargo.toml --features llvm -- --test-threads=1 $(runargs)
|
2019-03-06 12:44:19 -08:00
|
|
|
|
2019-04-10 17:15:47 -07:00
|
|
|
test-emscripten-clif:
|
|
|
|
cargo test --manifest-path lib/emscripten/Cargo.toml --features clif -- --test-threads=1 $(runargs)
|
|
|
|
|
2019-04-11 12:44:03 -07:00
|
|
|
test-emscripten-singlepass:
|
2019-05-05 14:18:12 -07:00
|
|
|
cargo test --manifest-path lib/emscripten/Cargo.toml --features singlepass -- --test-threads=1 $(runargs)
|
2019-03-18 01:13:04 +08:00
|
|
|
|
2019-05-17 12:09:31 -07:00
|
|
|
test-wasi-clif:
|
|
|
|
cargo test --manifest-path lib/wasi/Cargo.toml --features "clif" -- $(runargs)
|
|
|
|
|
2019-04-11 12:44:03 -07:00
|
|
|
singlepass-debug-release:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo +nightly build --features backend:singlepass,debug --release
|
2019-04-06 10:29:15 -07:00
|
|
|
|
2019-04-11 12:44:03 -07:00
|
|
|
singlepass-release:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo +nightly build --features backend:singlepass --release
|
2019-04-06 10:29:15 -07:00
|
|
|
|
2019-04-11 12:44:03 -07:00
|
|
|
singlepass-build:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo +nightly build --features backend:singlepass,debug
|
2019-04-06 10:29:15 -07:00
|
|
|
|
2018-11-13 10:28:50 -08:00
|
|
|
release:
|
|
|
|
# If you are in OS-X, you will need mingw-w64 for cross compiling to windows
|
|
|
|
# brew install mingw-w64
|
2019-03-19 22:00:50 +08:00
|
|
|
cargo build --release
|
2018-11-13 10:28:50 -08:00
|
|
|
|
2019-04-11 15:33:02 -07:00
|
|
|
production-release:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo build --release --features backend:singlepass,backend:llvm,loader:kernel
|
2019-04-11 15:33:02 -07:00
|
|
|
|
2018-11-26 11:47:33 -08:00
|
|
|
debug-release:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo build --release --features debug
|
2018-11-26 11:47:33 -08:00
|
|
|
|
2019-05-05 12:17:10 -07:00
|
|
|
extra-debug-release:
|
2019-05-15 10:35:09 -07:00
|
|
|
cargo build --release --features extra-debug
|
2019-05-05 12:17:10 -07:00
|
|
|
|
2018-11-13 10:28:50 -08:00
|
|
|
publish-release:
|
|
|
|
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
|