-
Notifications
You must be signed in to change notification settings - Fork 837
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·80 lines (64 loc) · 2.44 KB
/
Makefile
File metadata and controls
executable file
·80 lines (64 loc) · 2.44 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Makefile for production builds. This is not meant, or optimized, for incremental or debug builds. Use the devnet for
# development. For the sake of decentralization, we specifically avoid the use of prebuilt containers wherever possible
# to increase diversity - operators sourcing their compiler binaries from different sources is a good thing.
SHELL = /usr/bin/env bash
MAKEFLAGS += --no-builtin-rules
PREFIX ?= /usr/local
OUT = build
BIN = $(OUT)/bin
-include Makefile.help
# VERSION is the git tag of the current commit if there's a tag, otherwise it's "dev-" plus the git commit sha.
VERSION = $(shell git describe --tags --dirty 2>/dev/null || echo "dev-$(shell git rev-parse --short HEAD)")
.PHONY: dirs
dirs: Makefile
@mkdir -p $(BIN)
.PHONY: install
## Install guardiand binary
install:
install -m 775 $(BIN)/* $(PREFIX)/bin
setcap cap_ipc_lock=+ep $(PREFIX)/bin/guardiand
.PHONY: generate
generate: dirs
cd tools && ./build.sh
rm -rf bridge
rm -rf node/pkg/proto
tools/bin/buf generate
.PHONY: lint
lint:
# Lints spelling and Go
bash scripts/lint.sh lint
.PHONY: lint-rust
lint-rust:
# Runs clippy for most Rust crates.
bash scripts/clippy.sh
.PHONY: node
## Build guardiand binary
node: $(BIN)/guardiand
.PHONY: $(BIN)/guardiand
$(BIN)/guardiand: CGO_ENABLED=1
$(BIN)/guardiand: dirs generate
cd node && go build -ldflags "-X github.com/certusone/wormhole/node/pkg/version.version=${VERSION}" \
-mod=readonly -o ../$(BIN)/guardiand \
github.com/certusone/wormhole/node
.PHONY: test-coverage
## Run tests with coverage for node and sdk (matches CI)
test-coverage:
@echo "Running tests with coverage for node and sdk..."
@set -o pipefail && (cd node && go test -v -timeout 5m -race -cover ./...) 2>&1 | tee coverage.txt
@set -o pipefail && (cd sdk && go test -v -timeout 5m -race -cover ./...) 2>&1 | tee -a coverage.txt
.PHONY: check-coverage
## Check coverage against baseline (run tests first)
check-coverage: build-coverage-check test-coverage
@./coverage-check
.PHONY: check-coverage-verbose
## Check coverage against baseline (run tests first)
check-coverage-verbose: build-coverage-check test-coverage
@./coverage-check -v
.PHONY: build-coverage-check
## Build the coverage checker tool
build-coverage-check:
@cd scripts/coverage-check && go build -o ../../coverage-check .
.PHONY: update-coverage-baseline
## Update coverage baseline with current coverage
update-coverage-baseline: build-coverage-check test-coverage
@./coverage-check -u