From e8c1b990f6324c97b3011d73d509a5c528e19561 Mon Sep 17 00:00:00 2001 From: Adir Shitrit Date: Sat, 8 Nov 2025 12:22:43 +0200 Subject: [PATCH] add Makefile for build automation and development --- Makefile | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a8f233e --- /dev/null +++ b/Makefile @@ -0,0 +1,98 @@ +.PHONY: build test clean install dev-setup check fmt clippy doc + +# Default target +all: build + +# Build the project +build: + cargo build --release + +# Build for development +dev: + cargo build + +# Run tests +test: + cargo test + +# Clean build artifacts +clean: + cargo clean + +# Install locally +install: build + cargo install --path ghost-cli + +# Development setup +dev-setup: + rustup component add clippy rustfmt + cargo install cargo-audit + +# Check code quality +check: + cargo check + cargo clippy -- -D warnings + cargo audit + +# Format code +fmt: + cargo fmt + +# Run clippy +clippy: + cargo clippy -- -D warnings + +# Generate documentation +doc: + cargo doc --open + +# Run CLI with default args +run: + cargo run --bin ghost-cli + +# Run CLI with verbose output +run-verbose: + cargo run --bin ghost-cli -- --verbose + +# Run CLI with JSON output +run-json: + cargo run --bin ghost-cli -- --format json + +# Run CLI with CSV output +run-csv: + cargo run --bin ghost-cli -- --format csv + +# Run TUI +run-tui: + cargo run --bin ghost-tui + +# Watch mode for development +watch: + cargo watch -x check -x test -x "run --bin ghost-cli" + +# Profile build size +size: build + @echo "Binary sizes:" + @du -h target/release/ghost-cli target/release/ghost-tui 2>/dev/null || true + +# Help +help: + @echo "Available targets:" + @echo " build - Build release version" + @echo " dev - Build development version" + @echo " test - Run tests" + @echo " clean - Clean build artifacts" + @echo " install - Install CLI locally" + @echo " dev-setup - Setup development environment" + @echo " check - Run code quality checks" + @echo " fmt - Format code" + @echo " clippy - Run clippy linter" + @echo " doc - Generate documentation" + @echo " run - Run CLI with default args" + @echo " run-verbose- Run CLI with verbose output" + @echo " run-json - Run CLI with JSON output" + @echo " run-csv - Run CLI with CSV output" + @echo " run-tui - Run TUI interface" + @echo " watch - Watch mode for development" + @echo " size - Show binary sizes" + @echo " help - Show this help" \ No newline at end of file