summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: d01b68b798cb4b548159cfba43620c808ff56606 (plain)
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
.PHONY: proto proto-lint proto-breaking test build clean

# Generate proto files
proto:
	buf generate

# Lint proto files
proto-lint:
	buf lint

# Check for breaking changes
proto-breaking:
	buf breaking --against '.git#branch=main'

# Run tests
test:
	go test ./...

# Build the relay
build:
	go build -o bin/relay ./cmd/relay

# Clean generated files
clean:
	rm -rf api/
	rm -f bin/relay

# Install buf (if not already installed)
install-buf:
	@if ! command -v buf &> /dev/null; then \
		echo "Installing buf..."; \
		mkdir -p ~/.local/bin; \
		curl -sSL "https://github.com/bufbuild/buf/releases/latest/download/buf-$$(uname -s)-$$(uname -m)" -o ~/.local/bin/buf; \
		chmod +x ~/.local/bin/buf; \
		echo "buf installed to ~/.local/bin/buf"; \
		echo "Make sure ~/.local/bin is in your PATH"; \
	else \
		echo "buf is already installed"; \
	fi