-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (28 loc) · 921 Bytes
/
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
DOCKER = $(shell which docker)
BUILDDIR ?= $(CURDIR)/build
PACKAGES_E2E=$(shell go list ./... | grep '/itest')
ldflags := $(LDFLAGS)
build_tags := $(BUILD_TAGS)
build_args := $(BUILD_ARGS)
ifeq ($(VERBOSE),true)
build_args += -v
endif
ifeq ($(LINK_STATICALLY),true)
ldflags += -linkmode=external -extldflags "-Wl,-z,muldefs -static" -v
endif
BUILD_TARGETS := build install
BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)'
all: build install
build: BUILD_ARGS := $(build_args) -o $(BUILDDIR)
$(BUILD_TARGETS): go.sum $(BUILDDIR)/
go $@ -mod=readonly $(BUILD_FLAGS) $(BUILD_ARGS) ./...
$(BUILDDIR)/:
mkdir -p $(BUILDDIR)/
build-docker:
$(DOCKER) build --tag babylonlabs-io/covenant-signer -f Dockerfile \
$(shell git rev-parse --show-toplevel)
.PHONY: build build-docker install tests
test:
go test ./...
test-e2e:
go test -mod=readonly -timeout=25m -v $(PACKAGES_E2E) -count=1 --tags=e2e