PREFIX ?= /usr/local
BINDIR = $(PREFIX)/bin
TARGET_DIR = target/release
.PHONY: build install uninstall test clean help dev
build:
@echo "Building tango..."
@cargo build --release
@echo "Build complete! Binary is at $(TARGET_DIR)/tango"
install: build
@echo "Installing tango to $(BINDIR)..."
@install -d $(BINDIR)
@install -m 755 $(TARGET_DIR)/tango $(BINDIR)/tango
@echo "tango installed successfully!"
@echo "You can now run: tango"
uninstall:
@echo "Uninstalling tango from $(BINDIR)..."
@rm -f $(BINDIR)/tango
@echo "tango uninstalled successfully!"
test:
@echo "Running tests..."
@cargo test
@echo "Running dependency checks..."
@command -v tmux >/dev/null 2>&1 && echo "✓ tmux is installed" || echo "✗ tmux not found"
@command -v rustc >/dev/null 2>&1 && echo "✓ Rust is installed" || echo "✗ Rust not found"
clean:
@echo "Cleaning build artifacts..."
@cargo clean
@echo "Clean complete!"
dev:
@echo "Building in debug mode..."
@cargo build
@echo "Debug build complete! Binary is at target/debug/tango"
help:
@echo "Available targets:"
@echo " build - Build the release binary"
@echo " install - Build and install tango to $(BINDIR)"
@echo " uninstall - Remove tango from $(BINDIR)"
@echo " test - Run tests and dependency checks"
@echo " clean - Clean build artifacts"
@echo " dev - Build in debug mode"
@echo " help - Show this help message"
@echo ""
@echo "Variables:"
@echo " PREFIX - Installation prefix (default: /usr/local)"