CARGO_CMD ?= cargo
RUST_VERSION=$(shell rustc --version)
RUST_NIGHTLY = $(findstring nightly,$(RUST_VERSION))
test:
ifeq ($(RUST_NIGHTLY), nightly)
$(MAKE) run-all TASK="test"
$(CARGO_CMD) clean
$(CARGO_CMD) test --manifest-path vector/Cargo.toml --no-default-features --lib
$(CARGO_CMD) clean
$(CARGO_CMD) test --no-default-features --features std,use_sse2,matrix
$(CARGO_CMD) clean
$(CARGO_CMD) test --no-default-features --features std,use_avx2,matrix
else
$(MAKE) run-all TASK="test"
endif
bench:
ifeq ($(RUST_NIGHTLY), nightly)
$(CARGO_CMD) bench
else
@echo "Bench requires Rust nigthly, skipping bench for $(RUST_VERSION)"
endif
clean:
$(MAKE) run-all TASK="clean"
update:
$(MAKE) run-all TASK="update"
build:
$(MAKE) run-all TASK="build"
format:
cargo fmt
cargo fmt --manifest-path vector/Cargo.toml
cargo fmt --manifest-path matrix/Cargo.toml
cargo fmt --manifest-path interop/Cargo.toml
build_all: build
ifeq ($(RUST_NIGHTLY), nightly)
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features --features std
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features --features std,use_sse2
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features --features std,use_avx2
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features
else
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features --features std
$(CARGO_CMD) clean --manifest-path vector/Cargo.toml
$(CARGO_CMD) build --manifest-path vector/Cargo.toml --no-default-features
endif
test_all: test
ifeq ($(RUST_NIGHTLY), nightly)
$(CARGO_CMD) clean
$(CARGO_CMD) test --manifest-path vector/Cargo.toml --no-default-features --lib
$(CARGO_CMD) test --no-default-features --features std,use_sse2,matrix
$(CARGO_CMD) test --no-default-features --features std,use_avx2,matrix
else
$(CARGO_CMD) clean
$(CARGO_CMD) test --manifest-path vector/Cargo.toml --features matrix --no-default-features --lib
endif
run-all:
$(CARGO_CMD) $(TASK) --no-default-features --features std,matrix
$(CARGO_CMD) $(TASK) --manifest-path vector/Cargo.toml --no-default-features --features std
$(CARGO_CMD) $(TASK) --manifest-path matrix/Cargo.toml
$(CARGO_CMD) $(TASK) --manifest-path interop/Cargo.toml