BINARY_NAME = git-x
CARGO = cargo
.PHONY: all build ci run test coverage install uninstall fmt fmt-check lint lint-check clean publish help publish-optimized analyze-size
all: run
build:
$(CARGO) build --release
ci: fmt-check lint-check test
run: build
./target/release/$(BINARY_NAME) $(ARGS)
test:
$(CARGO) test -- --test-threads=1
coverage:
$(CARGO) tarpaulin --workspace --timeout 120 --out Stdout --jobs 1
fmt:
$(CARGO) fmt --all && $(CARGO) clippy --fix --allow-dirty
fmt-check:
$(CARGO) fmt --all -- --check
lint:
$(CARGO) clippy --all-targets -- -D warnings
lint-check:
$(CARGO) clippy --all-targets --all-features -- -D warnings
install: build
$(CARGO) install --path .
uninstall:
$(CARGO) uninstall $(BINARY_NAME)
clean:
$(CARGO) clean
analyze-size: build
@echo "=== Performance-Optimized Binary Analysis ==="
@ls -lh target/release/$(BINARY_NAME)
@echo ""
@echo "=== Crate Size Breakdown ==="
$(CARGO) bloat --release --crates
@echo ""
@echo "=== Top Functions ==="
$(CARGO) bloat --release -n 10
publish: build test
$(CARGO) publish
help:
@echo ""
@echo "git-x Makefile — available targets:"
@echo " make Build and run (default)"
@echo " make build Build release binary"
@echo " make run Run binary with ARGS=\"info\""
@echo " make test Run tests"
@echo " make coverage Generate test coverage report"
@echo " make fmt Format code"
@echo " make fmt-check Check formatting"
@echo " make lint Lint with Clippy"
@echo " make lint-check Check for linting issues"
@echo " make install Install to ~/.cargo/bin as 'git-x'"
@echo " make uninstall Uninstall binary"
@echo " make clean Remove build artifacts"
@echo " make ci Run CI checks (formatting, linting, tests)"
@echo ""
@echo "Optimization Targets:"
@echo " make analyze-size Analyze binary size and dependencies"
@echo " make publish-optimized Publish optimized binary to crates.io"
@echo " make publish Publish to crates.io (standard)"
@echo ""