.PHONY: all build install test clean release lint fmt
all: build
build:
cargo build --release
install: build
@echo "Installing trimdown to ~/.local/bin..."
@mkdir -p ~/.local/bin
@cp target/release/trimdown ~/.local/bin/
@chmod +x ~/.local/bin/trimdown
@echo "✓ Installed to ~/.local/bin/trimdown"
@echo ""
@if [[ ":$$PATH:" != *":$$HOME/.local/bin:"* ]]; then \
echo "⚠ Warning: ~/.local/bin is not in your PATH"; \
echo "Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.):"; \
echo "export PATH=\"\$$PATH:$$HOME/.local/bin\""; \
fi
test:
cargo test
lint:
cargo clippy -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
release:
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make release VERSION=x.x.x"; \
exit 1; \
fi
@./scripts/release.sh $(VERSION)
update-brew:
@if [ -z "$(VERSION)" ]; then \
echo "Usage: make update-brew VERSION=x.x.x"; \
exit 1; \
fi
@./scripts/update-formula.sh $(VERSION)
clean:
cargo clean
check: lint fmt-check test
@echo "✓ All checks passed!"
install-script:
@./scripts/install.sh