This repository was archived by the owner on Jun 15, 2026. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
100 lines (83 loc) · 2.78 KB
/
Copy pathMakefile
File metadata and controls
100 lines (83 loc) · 2.78 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.PHONY: all build clean test aggregator monitor-api unified p2p-gateway dequeuer event-monitor state-tracker
# Build output directory
BIN_DIR := bin
# Build all binaries
all: build
build: aggregator monitor-api unified p2p-gateway state-tracker
# Individual component builds
aggregator:
@echo "Building aggregator..."
@mkdir -p $(BIN_DIR)
@go build -o $(BIN_DIR)/aggregator ./cmd/aggregator
monitor-api:
@echo "Building monitor-api..."
@mkdir -p $(BIN_DIR)
@go build -o $(BIN_DIR)/monitor-api ./cmd/monitor-api
unified:
@echo "Building unified sequencer..."
@mkdir -p $(BIN_DIR)
@go build -o $(BIN_DIR)/unified ./cmd/unified
p2p-gateway:
@echo "Building p2p-gateway..."
@mkdir -p $(BIN_DIR)
@go build -o $(BIN_DIR)/p2p-gateway ./cmd/p2p-gateway
state-tracker:
@echo "Building state-tracker..."
@mkdir -p $(BIN_DIR)
@go build -o $(BIN_DIR)/state-tracker ./cmd/state-tracker
# Aliases for unified sequencer components
dequeuer: unified
event-monitor: unified
# Clean build artifacts
clean:
@echo "Cleaning build artifacts..."
@rm -rf $(BIN_DIR)
@rm -f aggregator monitor-api unified p2p-gateway
# Run tests
test:
@echo "Running tests..."
@go test -v ./...
# Run tests with race detection
test-race:
@echo "Running tests with race detection..."
@go test -race -v ./...
# Build with optimizations for production
build-prod:
@echo "Building for production..."
@mkdir -p $(BIN_DIR)
@go build -ldflags="-s -w" -o $(BIN_DIR)/aggregator ./cmd/aggregator
@go build -ldflags="-s -w" -o $(BIN_DIR)/monitor-api ./cmd/monitor-api
@go build -ldflags="-s -w" -o $(BIN_DIR)/unified ./cmd/unified
@go build -ldflags="-s -w" -o $(BIN_DIR)/p2p-gateway ./cmd/p2p-gateway
@go build -ldflags="-s -w" -o $(BIN_DIR)/state-tracker ./cmd/state-tracker
@echo "Production builds complete in $(BIN_DIR)/"
# Install dependencies
deps:
@echo "Installing dependencies..."
@go mod download
@go mod tidy
# Format code
fmt:
@echo "Formatting code..."
@go fmt ./...
# Run linter
lint:
@echo "Running linter..."
@golangci-lint run
# Display help
help:
@echo "Available targets:"
@echo " make build - Build all components"
@echo " make build-prod - Build with production optimizations"
@echo " make aggregator - Build aggregator component"
@echo " make monitor-api - Build monitoring API"
@echo " make unified - Build unified sequencer"
@echo " make p2p-gateway - Build P2P gateway"
@echo " make state-tracker - Build state tracker service"
@echo " make clean - Remove build artifacts"
@echo " make test - Run tests"
@echo " make test-race - Run tests with race detection"
@echo " make deps - Install/update dependencies"
@echo " make fmt - Format code"
@echo " make lint - Run linter"
@echo " make help - Show this help"