all: setup validate
validate: build lint test

setup:
	curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
	rustup toolchain install stable
	rustup component add clippy
	rustup component add rustfmt

build:
	cargo build

lint:
	cargo +nightly fmt --all
	cargo +nightly clippy --all --tests --all-targets --all-features

test:
	cargo test --all --verbose

release:
	cargo build --release
	cp ./target/release/hostile /usr/local/bin/hostile

publish:
	make validate
	cargo publish
