-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (33 loc) · 1.38 KB
/
Copy pathMakefile
File metadata and controls
46 lines (33 loc) · 1.38 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
.PHONY: build test test-all test-unit test-e2e test-tier2 test-tier3 test-tier4 cross-compile clean
BINARY=cmm
GO ?= $(shell which go 2>/dev/null || echo "./go/bin/go")
build:
$(GO) build -o $(BINARY) ./cmd/cmm/
test: test-unit test-e2e test-tier2 test-tier3 test-tier4
test-all: test-unit test-e2e test-tier2 test-tier3 test-tier4
test-unit:
$(GO) test -v ./internal/...
test-e2e: build
$(GO) test -v ./e2e/tier1/...
test-tier2: build
$(GO) test -v ./e2e/tier2/...
test-tier3: build
$(GO) test -v ./e2e/tier3/...
test-tier4: build
$(GO) test -v ./e2e/tier4/...
VERSION ?= v0.1.0
cross-compile:
mkdir -p bin
GOOS=linux GOARCH=arm64 $(GO) build -o bin/$(BINARY)-linux-arm64 ./cmd/cmm/
GOOS=linux GOARCH=amd64 $(GO) build -o bin/$(BINARY)-linux-amd64 ./cmd/cmm/
GOOS=darwin GOARCH=arm64 $(GO) build -o bin/$(BINARY)-darwin-arm64 ./cmd/cmm/
GOOS=darwin GOARCH=amd64 $(GO) build -o bin/$(BINARY)-darwin-amd64 ./cmd/cmm/
GOOS=windows GOARCH=amd64 $(GO) build -o bin/$(BINARY)-windows-amd64.exe ./cmd/cmm/
cp bin/$(BINARY)-linux-arm64 bin/$(BINARY)-$(VERSION)-linux-arm64
cp bin/$(BINARY)-linux-amd64 bin/$(BINARY)-$(VERSION)-linux-amd64
cp bin/$(BINARY)-darwin-arm64 bin/$(BINARY)-$(VERSION)-darwin-arm64
cp bin/$(BINARY)-darwin-amd64 bin/$(BINARY)-$(VERSION)-darwin-amd64
cp bin/$(BINARY)-windows-amd64.exe bin/$(BINARY)-$(VERSION)-windows-amd64.exe
clean:
rm -f $(BINARY)
rm -rf bin/