-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (40 loc) · 1.81 KB
/
Copy pathMakefile
File metadata and controls
55 lines (40 loc) · 1.81 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
# Makefile for altinity-mcp
VERSION ?= $(shell git describe --tags --dirty --always 2>/dev/null || echo dev)
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
LDFLAGS := -s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)
.PHONY: all build test vet fmt tidy clean docker run help
all: build
## build: build the altinity-mcp and jwe-token-generator binaries into the project root
build: altinity-mcp jwe-token-generator
## altinity-mcp: build the altinity-mcp binary into the project root
altinity-mcp: $(shell find cmd/altinity-mcp pkg -type f -name '*.go' 2>/dev/null) go.mod go.sum
CGO_ENABLED=0 go build -trimpath -ldflags '$(LDFLAGS)' -o altinity-mcp ./cmd/altinity-mcp
## jwe-token-generator: build the jwe-token-generator binary into the project root
jwe-token-generator: $(shell find cmd/jwe_auth pkg/jwe_auth -type f -name '*.go' 2>/dev/null) go.mod go.sum
CGO_ENABLED=0 go build -trimpath -ldflags '$(LDFLAGS)' -o jwe-token-generator ./cmd/jwe_auth
## test: run all unit tests
test:
go test ./...
## vet: run go vet
vet:
go vet ./...
## fmt: format all Go sources
fmt:
go fmt ./...
## tidy: tidy go.mod / go.sum
tidy:
go mod tidy
## run: build and run altinity-mcp (pass args via ARGS=)
run: altinity-mcp
./altinity-mcp $(ARGS)
## docker: build the container image (tag with VERSION, also tag :latest)
docker: build
docker build -t ghcr.io/altinity/altinity-mcp:$(VERSION) -t ghcr.io/altinity/altinity-mcp:latest .
## clean: remove built binaries
clean:
rm -f ./altinity-mcp ./jwe-token-generator
go clean -testcache
## help: show this help
help:
@awk 'BEGIN {FS = ":.*##"; printf "Targets:\n"} /^## [a-zA-Z_-]+:/ {sub(/^## /,""); split($$0,a,":"); printf " \033[36m%-22s\033[0m %s\n", a[1], a[2]}' $(MAKEFILE_LIST)