rskiller 0.2.1

Find and clean Rust project build artifacts and caches with parallel processing
Documentation
# Makefile for rskiller

.PHONY: help build test release clean install uninstall package

# Default target
help:
	@echo "Available targets:"
	@echo "  build     - Build the project in release mode"
	@echo "  test      - Run all tests"
	@echo "  release   - Create a new release (requires VERSION)"
	@echo "  clean     - Clean build artifacts"
	@echo "  install   - Install binary to /usr/local/bin"
	@echo "  uninstall - Remove binary from /usr/local/bin"
	@echo "  package   - Create distribution packages"
	@echo "  completions - Generate shell completions"

# Build project
build:
	cargo build --release

# Run tests
test:
	cargo test --all-features
	cargo clippy -- -D warnings
	cargo fmt --all -- --check

# Create a new release
release:
	@if [ -z "$(VERSION)" ]; then \
		echo "Please specify VERSION (e.g., make release VERSION=v0.2.1)"; \
		exit 1; \
	fi
	@echo "Creating release $(VERSION)"
	# Update version in Cargo.toml
	sed -i.bak 's/version = "[^"]*"/version = "$(VERSION:v%=%)"/' Cargo.toml
	# Commit and tag
	git add Cargo.toml
	git commit -m "Bump version to $(VERSION)"
	git tag $(VERSION)
	git push origin main $(VERSION)

# Clean build artifacts
clean:
	cargo clean
	rm -rf target/
	rm -f *.deb *.rpm *.tar.gz *.zip

# Install binary
install: build
	sudo cp target/release/rskiller /usr/local/bin/
	sudo chmod +x /usr/local/bin/rskiller

# Uninstall binary
uninstall:
	sudo rm -f /usr/local/bin/rskiller

# Generate shell completions
completions: build
	mkdir -p completions
	./target/release/rskiller --completion bash > completions/rskiller.bash
	./target/release/rskiller --completion zsh > completions/_rskiller
	./target/release/rskiller --completion fish > completions/rskiller.fish
	./target/release/rskiller --completion powershell > completions/rskiller.ps1

# Create distribution packages
package: build
	# Create tarball for Unix systems
	mkdir -p dist/rskiller-$(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')
	cp target/release/rskiller dist/rskiller-$(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')/
	cp README.md LICENSE dist/rskiller-$(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')/
	cd dist && tar -czf rskiller-$(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')-linux-x64.tar.gz rskiller-$(shell cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')

# Cross-compile for multiple targets
cross-compile:
	# Install targets
	rustup target add x86_64-pc-windows-gnu
	rustup target add x86_64-apple-darwin
	rustup target add aarch64-apple-darwin
	rustup target add aarch64-unknown-linux-gnu
	
	# Build for different targets
	cargo build --release --target x86_64-unknown-linux-gnu
	cargo build --release --target x86_64-pc-windows-gnu
	# Note: Cross-compiling for macOS from Linux requires additional setup

# Development helpers
dev-setup:
	rustup component add rustfmt clippy
	cargo install cargo-audit cargo-deny
	
check-security:
	cargo audit
	cargo deny check

# Documentation
docs:
	cargo doc --all-features --no-deps --open

# Benchmark (if we add benchmarks)
bench:
	cargo bench