-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (40 loc) · 1.01 KB
/
Makefile
File metadata and controls
52 lines (40 loc) · 1.01 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
.PHONY: build run run-stdio run-sse run-streamable clean test fmt lint
# Binary name.
BINARY_NAME=d2mcp
# Build the binary.
build:
go build -o $(BINARY_NAME) ./cmd
# Run the server.
run: build
./$(BINARY_NAME)
# Run with STDIO transport.
run-stdio: build
./$(BINARY_NAME) -transport=stdio
# Run with SSE transport.
run-sse: build
./$(BINARY_NAME) -transport=sse
# Run with Streamable HTTP transport.
run-streamable: build
./$(BINARY_NAME) -transport=streamable
# Clean build artifacts.
clean:
rm -f $(BINARY_NAME)
# Run tests.
test:
go test -v ./...
# Format code.
fmt:
go fmt ./...
# Run linter.
lint:
golangci-lint run
# Install dependencies.
deps:
go mod download
go mod tidy
# Build for multiple platforms.
build-all:
GOOS=darwin GOARCH=amd64 go build -o $(BINARY_NAME)-darwin-amd64 ./cmd
GOOS=darwin GOARCH=arm64 go build -o $(BINARY_NAME)-darwin-arm64 ./cmd
GOOS=linux GOARCH=amd64 go build -o $(BINARY_NAME)-linux-amd64 ./cmd
GOOS=windows GOARCH=amd64 go build -o $(BINARY_NAME)-windows-amd64.exe ./cmd