github.com/aakash4dev/cometbft@v0.38.2/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/aakash4dev/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 (nostrip,$(findstring nostrip,$(COMETBFT_BUILD_OPTIONS)))
    13    #prepare for delve
    14    BUILD_FLAGS+= -gcflags "all=-N -l"
    15  else
    16    BUILD_FLAGS += -trimpath
    17    LD_FLAGS += -s -w
    18  endif
    19  
    20  # handle race
    21  ifeq (race,$(findstring race,$(COMETBFT_BUILD_OPTIONS)))
    22    CGO_ENABLED=1
    23    BUILD_FLAGS += -race
    24  endif
    25  
    26  # handle cleveldb
    27  ifeq (cleveldb,$(findstring cleveldb,$(COMETBFT_BUILD_OPTIONS)))
    28    CGO_ENABLED=1
    29    BUILD_TAGS += cleveldb
    30  endif
    31  
    32  # handle badgerdb
    33  ifeq (badgerdb,$(findstring badgerdb,$(COMETBFT_BUILD_OPTIONS)))
    34    BUILD_TAGS += badgerdb
    35  endif
    36  
    37  # handle rocksdb
    38  ifeq (rocksdb,$(findstring rocksdb,$(COMETBFT_BUILD_OPTIONS)))
    39    CGO_ENABLED=1
    40    BUILD_TAGS += rocksdb
    41  endif
    42  
    43  # handle boltdb
    44  ifeq (boltdb,$(findstring boltdb,$(COMETBFT_BUILD_OPTIONS)))
    45    BUILD_TAGS += boltdb
    46  endif