-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
109 lines (88 loc) · 2.58 KB
/
Makefile
File metadata and controls
109 lines (88 loc) · 2.58 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
101
102
103
104
105
106
107
108
109
MACOS_MIN ?= 11.0
GO ?= go
PROTOC ?= protoc
CONFIG ?= .
WAILS ?= $(BIN_DIR)/wails3
VERSION ?= dev
BUILD ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "unknown")
LDFLAGS := -X mcpv/internal/buildinfo.Version=$(VERSION) -X mcpv/internal/buildinfo.Build=$(BUILD)
BIN_DIR ?= $(CURDIR)/bin
WIRE := $(BIN_DIR)/wire
.PHONY: dev obs down reload proto wire tools build bump
export MACOSX_DEPLOYMENT_TARGET=$(MACOS_MIN)
export CGO_CFLAGS=-mmacosx-version-min=$(MACOS_MIN)
export CGO_CXXFLAGS=-mmacosx-version-min=$(MACOS_MIN)
export CGO_LDFLAGS=-mmacosx-version-min=$(MACOS_MIN)
install-toolchain:
$(MAKE) $(WIRE) $(WAILS)
build:
mkdir -p bin/core
$(GO) build -ldflags "$(LDFLAGS)" -o bin/core/mcpv ./cmd/mcpv
$(GO) build -ldflags "$(LDFLAGS)" -o bin/core/mcpvmcp ./cmd/mcpvmcp
$(GO) build -ldflags "$(LDFLAGS)" -o bin/core/mcpvctl ./cmd/mcpvctl
test:
$(GO) test ./...
fmt:
$(GO) fmt ./...
lint-check:
@command -v golangci-lint >/dev/null 2>&1 || { \
echo "golangci-lint not found. Install it with: brew install golangci-lint"; \
exit 1; \
}
golangci-lint run --config .golangci.yml
lint-fix:
@command -v golangci-lint >/dev/null 2>&1 || { \
echo "golangci-lint not found. Install it with: brew install golangci-lint"; \
exit 1; \
}
golangci-lint run --config .golangci.yml --fix
proto:
$(PROTOC) -I proto \
--go_out=. \
--go-grpc_out=. \
--go_opt=module=mcpv \
--go-grpc_opt=module=mcpv \
proto/mcpv/control/v1/control.proto \
proto/mcpv/plugin/v1/plugin.proto
$(WIRE):
GOBIN=$(BIN_DIR) $(GO) install github.com/google/wire/cmd/wire@latest
$(WAILS):
GOBIN=$(BIN_DIR) $(GO) install github.com/wailsapp/wails/v3/cmd/wails3@v3.0.0-alpha.70
wire:
$(WIRE) ./internal/app
# Docker Compose development environment
dev:
docker compose up -d
obs:
mcpv_PROM_CONFIG=./dev/prometheus.wails.yaml docker compose up -d prometheus grafana
down:
docker compose down
reload:
docker compose restart core
# Wails application targets
wails-bindings:
$(WAILS) generate bindings -ts
wails-dev:
$(WAILS) dev
wails-build:
$(WAILS) build
wails-package:
$(WAILS) package
bump: $(WAILS)
@if [ -z "$(VERSION)" ] || [ "$(VERSION)" = "dev" ]; then \
echo "VERSION is required (e.g. make bump VERSION=1.2.3)"; \
exit 1; \
fi
@if git rev-parse -q --verify "refs/tags/v$(VERSION)" >/dev/null; then \
echo "Tag v$(VERSION) already exists"; \
exit 1; \
fi
./scripts/bump.js "$(VERSION)"
$(WAILS) task common:update:build-assets
git add .
@if git diff --cached --quiet; then \
echo "No changes to commit"; \
exit 1; \
fi
git commit -s -m "Release: v$(VERSION)"
git tag "v$(VERSION)"