-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
59 lines (44 loc) · 2.49 KB
/
Makefile
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
VERSION = 0.2.13
GOBASE = $(shell pwd)
GOBIN = $(GOBASE)/build/bin
GOCMD = $(GOBASE)/cmd
build:
go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/rockx-dkg-cli $(GOCMD)/cli/main.go
build_messenger:
go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/messenger $(GOCMD)/messenger/main.go
build_node:
go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go
build_verify:
go build -o $(GOBIN)/verify $(GOCMD)/verify/main.go
release_darwin_arm64:
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-messenger $(GOCMD)/messenger/main.go
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go
GOOS=darwin GOARCH=arm64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/darwin_arm64/rockx-dkg-cli $(GOCMD)/cli/main.go
mkdir -p $(GOBASE)/release/$(VERSION)
cd $(GOBIN)/darwin_arm64 && pwd && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-messenger.$(VERSION).darwin.arm64.tar.gz rockx-dkg-messenger && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-node.$(VERSION).darwin.arm64.tar.gz rockx-dkg-node && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-cli.$(VERSION).darwin.arm64.tar.gz rockx-dkg-cli && \
cd $(GOBASE)
release_linux_amd64:
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-messenger $(GOCMD)/messenger/main.go
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-node $(GOCMD)/node/main.go $(GOCMD)/node/app_params.go
GOOS=linux GOARCH=amd64 go build -ldflags "-X main.version=$(VERSION) -s -w" -o $(GOBIN)/linux_amd64/rockx-dkg-cli $(GOCMD)/cli/main.go
mkdir -p $(GOBASE)/release/$(VERSION)
cd $(GOBIN)/linux_amd64 && pwd && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-messenger.$(VERSION).linux.amd64.tar.gz rockx-dkg-messenger && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-node.$(VERSION).linux.amd64.tar.gz rockx-dkg-node && \
tar -czvf $(GOBASE)/release/$(VERSION)/rockx-dkg-cli.$(VERSION).linux.amd64.tar.gz rockx-dkg-cli && \
cd $(GOBASE)
deps:
go mod download
test:
go test -v -cover ./... -coverprofile .testCoverage.txt
clean:
rm deposit-data_*
rm dkg_results_*
rm keyshares-*
rm $(GOBIN)/*
rm *.log
all: test build
.PHONY: all test clean build