forked from f/mcptools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (46 loc) · 1.63 KB
/
Copy pathMakefile
File metadata and controls
57 lines (46 loc) · 1.63 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
# Color definitions
BLUE=\033[0;34m
GREEN=\033[0;32m
YELLOW=\033[0;33m
RED=\033[0;31m
NC=\033[0m # No Color
BINARY_NAME=mcp
VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
BUILD_TIME=$(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
LDFLAGS=-ldflags "-X main.Version=$(VERSION) -X main.BuildTime=$(BUILD_TIME)"
# Default Makefile step
default: setup
@echo "$(GREEN)All setup steps completed successfully!$(NC)"
# Setup for Cocoapods
setup: \
check-go \
build \
clean \
install \
test
@echo "$(GREEN)Setup process completed$(NC)"
check-go:
@echo "$(BLUE)Checking Go installation and version...$(NC)"
chmod +x ./scripts/check_go.bash
./scripts/check_go.bash
build:
@echo "$(YELLOW)Building $(BINARY_NAME)...$(NC)"
go build $(LDFLAGS) -o bin/$(BINARY_NAME) ./cmd/mcptools
build-all: clean
@echo "$(YELLOW)Building all platform binaries...$(NC)"
GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_darwin_amd64 ./cmd/mcptools
GOOS=darwin GOARCH=arm64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_darwin_arm64 ./cmd/mcptools
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_linux_amd64 ./cmd/mcptools
GOOS=linux GOARCH=arm64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_linux_arm64 ./cmd/mcptools
GOOS=windows GOARCH=amd64 go build $(LDFLAGS) -o bin/$(BINARY_NAME)_windows_amd64.exe ./cmd/mcptools
install:
@echo "$(BLUE)Installing $(BINARY_NAME)...$(NC)"
go install $(LDFLAGS) ./cmd/mcptools
clean:
@echo "$(RED)Cleaning build artifacts...$(NC)"
test: check-go
@echo "$(YELLOW)Running tests...$(NC)"
go test -v ./...
lint: check_go
@echo "$(BLUE)Running linter...$(NC)"
golangci-lint run ./...