libmwemu 0.25.3

x86 32/64bits and system internals emulator, for securely emulating malware and other stuff.
Documentation
# libmwemu — build & test helpers (standalone repo).

CARGO_TARGET :=
ifeq ($(shell uname),Darwin)
	CARGO_TARGET := --target x86_64-apple-darwin
endif

# Password-protected bundle with the sample binaries (test/) and the
# proprietary Windows DLLs (maps/) that can't be redistributed in-repo.
# Published as a release asset on mwemuorg/libmwemu (tag: tests).
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)

# Always fetch the test bundle, overwrite ./test (and ./maps), drop the zip,
# then run the suite.
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