CARGO_TARGET :=
ifeq ($(shell uname),Darwin)
CARGO_TARGET := --target x86_64-apple-darwin
endif
TEST_ZIP_URL := https://github.com/mwemuorg/libmwemu/releases/download/tests/test.zip
TEST_ZIP_PASSWORD := mwemuTestSystem
.PHONY: build release tests fmt clippy clean
build:
cargo build $(CARGO_TARGET)
release:
cargo build --release $(CARGO_TARGET)
tests:
@echo "fetching test bundle..."
@if which wget >/dev/null 2>&1; then \
wget -q -O test.zip $(TEST_ZIP_URL); \
else \
curl -fsSL -o test.zip $(TEST_ZIP_URL); \
fi
unzip -o -P $(TEST_ZIP_PASSWORD) test.zip
rm -f test.zip
cargo test --verbose $(CARGO_TARGET)
cargo test --release --verbose $(CARGO_TARGET)
fmt:
cargo fmt --check
clippy:
cargo clippy
clean:
cargo clean
rm -rf test test.zip