-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (38 loc) · 993 Bytes
/
Makefile
File metadata and controls
51 lines (38 loc) · 993 Bytes
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
.PHONY: build test vet check qa qa-core qa-extended perf perf-loop dist release-snapshot clean
BINARY ?= mcpx
CMD ?= ./cmd/mcpx
DIST_DIR ?= dist
PLATFORMS ?= darwin/arm64 darwin/amd64 linux/amd64 linux/arm64
build:
go build -o $(BINARY) $(CMD)
test:
go test ./...
vet:
go vet ./...
check: test vet build
qa:
QA_SCOPE=all ./scripts/qa_matrix.sh
qa-core:
QA_SCOPE=core ./scripts/qa_matrix.sh
qa-extended:
QA_SCOPE=extended ./scripts/qa_matrix.sh
perf:
./scripts/perf_bench.sh
perf-loop:
./scripts/perf_cli_loop.sh
dist:
rm -rf "$(DIST_DIR)"
mkdir -p "$(DIST_DIR)"
@set -e; \
for platform in $(PLATFORMS); do \
os="$${platform%/*}"; \
arch="$${platform#*/}"; \
out="$(DIST_DIR)/mcpx-$${os}-$${arch}"; \
echo "building $$out"; \
CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build -ldflags="-s -w" -o "$$out" $(CMD); \
done
cd "$(DIST_DIR)" && shasum -a 256 mcpx-* > SHA256SUMS
release-snapshot:
goreleaser release --snapshot --clean
clean:
rm -f "$(BINARY)"