-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (34 loc) · 1.27 KB
/
Makefile
File metadata and controls
42 lines (34 loc) · 1.27 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
# mcprouter Makefile
#
# Targets:
# build — compile the mcprouter binary
# test — run all tests (works on Linux/macOS)
# test-win — run all tests on Windows with an explicit compile-then-exec
# fallback for packages that Windows Defender blocks inside
# the go-build temp dir.
# vet — go vet ./...
# fmt — gofmt -l . (fails if any files need formatting)
# clean — remove build output
BIN := bin/mcprouter
PKG := ./...
.PHONY: build test test-win vet fmt clean install
build:
go build -o $(BIN) ./cmd/mcprouter
test:
go test -count=1 $(PKG)
test-win:
@echo "Running tests with compile-and-exec fallback (Windows/Defender-safe)"
@mkdir -p testbin
@for pkg in backend capability config fallback health logging metrics router server transport loadbalance; do \
go test -c -o testbin/$${pkg}.test.exe ./internal/$${pkg}/ 2>/dev/null && \
./testbin/$${pkg}.test.exe || echo "SKIP internal/$${pkg}"; \
done
@go test -c -o testbin/jsonrpc.test.exe ./pkg/jsonrpc/ && ./testbin/jsonrpc.test.exe
@go test -c -o testbin/mcp.test.exe ./pkg/mcp/ && ./testbin/mcp.test.exe
@rm -rf testbin
vet:
go vet $(PKG)
fmt:
@test -z "$$(gofmt -l .)" || (echo "Run gofmt -w ." && gofmt -l . && exit 1)
clean:
rm -rf bin testbin