github.com/KYVENetwork/cometbft/v38@v38.0.3/common.mk (about) 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/KYVENetwork/cometbft/v38/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