mcesptool/Makefile
Ryan Malloy 349351deec Add cross-platform bootstrap script for host environment setup
scripts/bootstrap.sh verifies and (optionally) installs everything
mcesptool needs on a host: system packages, ESP-IDF toolchains
including the optional QEMU + esp-clang that install.sh all skips,
uv, and the project venv. Supports Arch Linux (pacman) and macOS
(Homebrew, with cautious defaults that prefer user-owned ~/homebrew).

Runs idempotent: safe to re-run after a system reinstall or when
extending to a new dev machine. make bootstrap-check for read-only
verification; make bootstrap for install.
2026-07-04 19:00:34 -06:00

100 lines
2.5 KiB
Makefile

# MCP ESPTool Server Makefile
.PHONY: help bootstrap bootstrap-check install dev test lint format clean docker-build docker-up docker-down docker-logs
# Default target
help:
@echo "MCP ESPTool Server Development Commands"
@echo ""
@echo "Setup & Installation:"
@echo " bootstrap-check Verify host has everything mcesptool needs (read-only)"
@echo " bootstrap Install missing system pkgs, IDF tools, venv, group access"
@echo " install Install project with uv"
@echo " dev Install in development mode"
@echo ""
@echo "Development:"
@echo " test Run test suite"
@echo " lint Run linting checks"
@echo " format Format code with ruff"
@echo " clean Clean build artifacts"
@echo ""
@echo "Docker Operations:"
@echo " docker-build Build development container"
@echo " docker-up Start development environment"
@echo " docker-down Stop development environment"
@echo " docker-logs View container logs"
@echo ""
@echo "MCP Integration:"
@echo " mcp-install Install server with Claude Code"
@echo " mcp-test Test MCP server integration"
# Bootstrap (host-level environment setup: pacman/brew, ESP-IDF, uv, venv)
bootstrap-check:
@bash scripts/bootstrap.sh --check
bootstrap:
@bash scripts/bootstrap.sh --install
# Installation
install:
uv sync
dev:
uv sync --dev
uv run pre-commit install
# Testing and Quality
test:
PYTHONPATH=src uv run pytest tests/ -v
test-watch:
PYTHONPATH=src uv run pytest-watch tests/
lint:
uv run ruff check src/ tests/
uv run mypy src/
format:
uv run ruff format src/ tests/
uv run ruff check --fix src/ tests/
clean:
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf build/ dist/ *.egg-info/
rm -rf .pytest_cache/ .coverage .mypy_cache/
# Docker Operations
docker-build:
docker compose build
docker-up:
docker compose up -d
@echo "Development environment started"
@echo "Run 'make docker-logs' to view logs"
docker-down:
docker compose down
docker-logs:
docker compose logs -f
# MCP Integration
mcp-install:
claude mcp add mcp-esptool-server "uvx mcp-esptool-server"
@echo "MCP server installed with Claude Code"
@echo "You can now use it in Claude conversations"
mcp-test:
uvx mcp-esptool-server --help
@echo "Testing MCP server installation..."
# Development shortcuts
run:
uv run mcp-esptool-server
run-debug:
uv run mcp-esptool-server --debug
run-production:
uv run mcp-esptool-server --production