Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
66 lines (51 loc) · 1.74 KB
/
Copy pathMakefile
File metadata and controls
66 lines (51 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
.PHONY: help build run test test-short coverage bench lint fmt vet clean deps install check
# Default target
help: ## Show this help message
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
build: ## Build the aixgate binary
@echo "Building aixgate..."
@mkdir -p dist
@CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o dist/aixgate ./cmd/aixgate
@echo "Built: ./dist/aixgate"
run: build ## Build and run aixgate
@./dist/aixgate
test: ## Run all tests
@echo "Running tests..."
@go test -v -race -coverprofile=coverage.out ./...
test-short: ## Run tests without race detector
@echo "Running tests (short)..."
@go test -v ./...
coverage: test ## Generate test coverage report
@go tool cover -html=coverage.out -o coverage.html
@echo "Coverage report generated: coverage.html"
bench: ## Run benchmarks
@echo "Running benchmarks..."
@go test -bench=. -benchmem ./...
lint: ## Run linter (requires golangci-lint)
@echo "Running linter..."
@if command -v golangci-lint >/dev/null 2>&1; then \
golangci-lint run; \
else \
echo "golangci-lint not installed. Install from https://golangci-lint.run/usage/install/"; \
fi
fmt: ## Format code
@echo "Formatting code..."
@go fmt ./...
@gofmt -s -w .
vet: ## Run go vet
@echo "Running go vet..."
@go vet ./...
clean: ## Clean build artifacts
@echo "Cleaning..."
@rm -f coverage.out coverage.html
@rm -rf dist/
deps: ## Download dependencies
@echo "Downloading dependencies..."
@go mod download
@go mod tidy
install: ## Install the aixgate binary
@echo "Installing aixgate..."
@go install ./cmd/aixgate
check: fmt vet lint test ## Run all checks (fmt, vet, lint, test)
.DEFAULT_GOAL := help