forked from strangelove-ventures/horcrux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (39 loc) · 1.59 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 := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
all: install
LD_FLAGS = -X github.com/strangelove-ventures/horcrux/v3/cmd/horcrux/cmd.Version=$(VERSION) \
-X github.com/strangelove-ventures/horcrux/v3/cmd/horcrux/cmd.Commit=$(COMMIT)
LD_FLAGS += $(LDFLAGS)
LD_FLAGS := $(strip $(LD_FLAGS))
BUILD_FLAGS := -ldflags '$(LD_FLAGS)'
build:
@go build -mod readonly $(BUILD_FLAGS) -o build/ ./cmd/horcrux/...
install:
@go install -mod readonly $(BUILD_FLAGS) ./cmd/horcrux/...
build-linux:
@GOOS=linux GOARCH=amd64 go build --mod readonly $(BUILD_FLAGS) -o ./build/horcrux ./cmd/horcrux
test:
@go test -race -timeout 30m -mod readonly -v ./...
test-short:
@go test -mod readonly -run TestDownedSigners2of3 -v ./...
test-signer-short:
@go test -mod readonly -run TestThresholdValidator2of3 -v ./...
clean:
rm -rf build
build-horcrux-docker:
docker build -t strangelove-ventures/horcrux:$(VERSION) -f ./docker/horcrux/Dockerfile .
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
mkfile_dir := $(dir $(mkfile_path))
DOCKER := $(shell which docker)
protoVer=0.11.2
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "Generating Protobuf files"
@$(protoImage) sh ./scripts/protocgen.sh
proto-format:
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;
proto-lint:
@$(protoImage) buf lint --error-format=json
.PHONY: all lint test race msan tools clean build