.PHONY: help build build-release test install install-dev clean clean-install uninstall
help:
@echo "๐ OSVM CLI Build & Installation Commands"
@echo "========================================"
@echo ""
@echo "Build Commands:"
@echo " make build - Build debug binary"
@echo " make build-release - Build optimized release binary"
@echo " make test - Run all tests"
@echo ""
@echo "Installation Commands:"
@echo " make install - Build release and install to /usr/bin (requires sudo)"
@echo " make install-dev - Install debug binary to /usr/bin (requires sudo)"
@echo " make uninstall - Remove osvm from /usr/bin (requires sudo)"
@echo ""
@echo "Cleanup Commands:"
@echo " make clean - Clean build artifacts"
@echo " make clean-install - Remove installed binaries and backups"
@echo ""
@echo "Development Commands:"
@echo " make run - Run the debug binary locally"
@echo " make check - Check code without building"
@echo " make fmt - Format code"
@echo " make clippy - Run clippy linter"
build:
@echo "๐จ Building debug binary..."
cargo build
build-release:
@echo "๐จ Building release binary..."
cargo build --release
test:
@echo "๐งช Running tests..."
cargo test
check:
@echo "๐ Checking code..."
cargo check
fmt:
@echo "๐จ Formatting code..."
cargo fmt
clippy:
@echo "๐ Running clippy..."
cargo clippy -- -D warnings
install: build-release
@echo "๐ฆ Installing release binary..."
./install-release.sh
install-dev: build
@echo "๐ฆ Installing debug binary..."
sudo cp target/debug/osvm /usr/bin/osvm
sudo chmod +x /usr/bin/osvm
@echo "โ
Debug binary installed to /usr/bin/osvm"
uninstall:
@echo "๐๏ธ Uninstalling osvm..."
sudo rm -f /usr/bin/osvm
@echo "โ
osvm removed from /usr/bin"
clean:
@echo "๐งน Cleaning build artifacts..."
cargo clean
clean-install: uninstall
@echo "๐งน Cleaning installed binaries and backups..."
sudo rm -f /usr/bin/osvm.backup
@echo "โ
All installed files cleaned"
run:
@echo "๐ Running debug binary..."
cargo run
verify-install:
@echo "๐งช Verifying installation..."
@if command -v osvm >/dev/null 2>&1; then \
echo "โ
osvm is installed and accessible"; \
echo "๐ Location: $$(which osvm)"; \
echo "๐ฆ Version: $$(osvm --version)"; \
else \
echo "โ osvm is not installed or not in PATH"; \
exit 1; \
fi
dev: clean build test
@echo "โ
Development build completed"
release: clean build-release test install
@echo "โ
Release build and installation completed"