File tree 3 files changed +50
-43
lines changed
3 files changed +50
-43
lines changed Original file line number Diff line number Diff line change
1
+ include common.mk
2
+
1
3
PACKAGES =$(shell go list ./...)
2
4
BUILDDIR? =$(CURDIR ) /build
3
5
OUTPUT? =$(BUILDDIR ) /cometbft
4
6
5
- BUILD_TAGS? =cometbft
6
-
7
- COMMIT_HASH := $(shell git rev-parse --short HEAD)
8
- LD_FLAGS = -X github.com/cometbft/cometbft/version.TMGitCommitHash=$(COMMIT_HASH )
9
- BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS ) "
10
7
HTTPS_GIT := https://github.com/cometbft/cometbft.git
11
8
CGO_ENABLED ?= 0
12
9
13
- # handle nostrip
14
- ifeq (,$(findstring nostrip,$(COMETBFT_BUILD_OPTIONS ) ) )
15
- BUILD_FLAGS += -trimpath
16
- LD_FLAGS += -s -w
17
- endif
18
-
19
- # handle race
20
- ifeq (race,$(findstring race,$(COMETBFT_BUILD_OPTIONS ) ) )
21
- CGO_ENABLED =1
22
- BUILD_FLAGS += -race
23
- endif
24
-
25
- # handle cleveldb
26
- ifeq (cleveldb,$(findstring cleveldb,$(COMETBFT_BUILD_OPTIONS ) ) )
27
- CGO_ENABLED =1
28
- BUILD_TAGS += cleveldb
29
- endif
30
-
31
- # handle badgerdb
32
- ifeq (badgerdb,$(findstring badgerdb,$(COMETBFT_BUILD_OPTIONS ) ) )
33
- BUILD_TAGS += badgerdb
34
- endif
35
-
36
- # handle rocksdb
37
- ifeq (rocksdb,$(findstring rocksdb,$(COMETBFT_BUILD_OPTIONS ) ) )
38
- CGO_ENABLED =1
39
- BUILD_TAGS += rocksdb
40
- endif
41
-
42
- # handle boltdb
43
- ifeq (boltdb,$(findstring boltdb,$(COMETBFT_BUILD_OPTIONS ) ) )
44
- BUILD_TAGS += boltdb
45
- endif
46
-
47
- # allow users to pass additional flags via the conventional LDFLAGS variable
48
- LD_FLAGS += $(LDFLAGS )
49
-
50
10
# Process Docker environment varible TARGETPLATFORM
51
11
# in order to build binary with correspondent ARCH
52
12
# by default will always build for linux/amd64
Original file line number Diff line number Diff line change
1
+ # This contains Makefile logic that is common to several makefiles
2
+
3
+ BUILD_TAGS ?= cometbft
4
+
5
+ COMMIT_HASH := $(shell git rev-parse --short HEAD)
6
+ LD_FLAGS = -X github.com/cometbft/cometbft/version.TMGitCommitHash=$(COMMIT_HASH )
7
+ BUILD_FLAGS = -mod=readonly -ldflags "$(LD_FLAGS ) "
8
+ # allow users to pass additional flags via the conventional LDFLAGS variable
9
+ LD_FLAGS += $(LDFLAGS )
10
+
11
+ # handle nostrip
12
+ ifeq (,$(findstring nostrip,$(COMETBFT_BUILD_OPTIONS ) ) )
13
+ BUILD_FLAGS += -trimpath
14
+ LD_FLAGS += -s -w
15
+ endif
16
+
17
+ # handle race
18
+ ifeq (race,$(findstring race,$(COMETBFT_BUILD_OPTIONS ) ) )
19
+ CGO_ENABLED =1
20
+ BUILD_FLAGS += -race
21
+ endif
22
+
23
+ # handle cleveldb
24
+ ifeq (cleveldb,$(findstring cleveldb,$(COMETBFT_BUILD_OPTIONS ) ) )
25
+ CGO_ENABLED =1
26
+ BUILD_TAGS += cleveldb
27
+ endif
28
+
29
+ # handle badgerdb
30
+ ifeq (badgerdb,$(findstring badgerdb,$(COMETBFT_BUILD_OPTIONS ) ) )
31
+ BUILD_TAGS += badgerdb
32
+ endif
33
+
34
+ # handle rocksdb
35
+ ifeq (rocksdb,$(findstring rocksdb,$(COMETBFT_BUILD_OPTIONS ) ) )
36
+ CGO_ENABLED =1
37
+ BUILD_TAGS += rocksdb
38
+ endif
39
+
40
+ # handle boltdb
41
+ ifeq (boltdb,$(findstring boltdb,$(COMETBFT_BUILD_OPTIONS ) ) )
42
+ BUILD_TAGS += boltdb
43
+ endif
Original file line number Diff line number Diff line change
1
+ COMETBFT_BUILD_OPTIONS += badgerdb,boltdb,cleveldb,rocksdb
2
+
3
+ include ../../common.mk
4
+
1
5
all : docker generator runner
2
6
3
7
docker :
@@ -10,7 +14,7 @@ docker:
10
14
# order to build a binary with a CometBFT node in it (for built-in
11
15
# ABCI testing).
12
16
node :
13
- go build - o build/node -tags badgerdb,boltdb,cleveldb,rocksdb ./node
17
+ go build $( BUILD_FLAGS ) -tags ' $(BUILD_TAGS) ' - o build/node ./node
14
18
15
19
generator :
16
20
go build -o build/generator ./generator
You can’t perform that action at this time.
0 commit comments