Skip to content

Commit

Permalink
support pgo
Browse files Browse the repository at this point in the history
  • Loading branch information
chengzhinei committed May 16, 2023
1 parent a0f2ef0 commit c76a3ba
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,18 @@ ifeq ($(DEBUG),true)
BUILD_FLAGS += -gcflags "all=-N -l"
endif

ifeq ($(PGO),true)
PGO_AUTO = -pgo=auto
endif

all: install

install: exchain


exchain: check_version
$(cgo_flags) go install -v $(BUILD_FLAGS) -tags "$(build_tags)" ./cmd/exchaind
$(cgo_flags) go install -v $(BUILD_FLAGS) -tags "$(build_tags)" ./cmd/exchaincli
$(cgo_flags) go install $(PGO_AUTO) -v $(BUILD_FLAGS) -tags "$(build_tags)" ./cmd/exchaind
$(cgo_flags) go install $(PGO_AUTO) -v $(BUILD_FLAGS) -tags "$(build_tags)" ./cmd/exchaincli

check_version:
@sh $(shell pwd)/libs/check/check-version.sh $(GO_VERSION) $(ROCKSDB_VERSION)
Expand Down Expand Up @@ -196,11 +200,11 @@ format:

build:
ifeq ($(OS),Windows_NT)
go build -pgo=auto $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaind.exe ./cmd/exchaind
go build -pgo=auto $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaincli.exe ./cmd/exchaincli
go build $(PGO_AUTO) $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaind.exe ./cmd/exchaind
go build $(PGO_AUTO) $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaincli.exe ./cmd/exchaincli
else
go build -pgo=auto $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaind ./cmd/exchaind
go build -pgo=auto $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaincli ./cmd/exchaincli
go build $(PGO_AUTO) $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaind ./cmd/exchaind
go build $(PGO_AUTO) $(BUILD_FLAGS) -tags "$(build_tags)" -o build/exchaincli ./cmd/exchaincli
endif


Expand Down

0 comments on commit c76a3ba

Please sign in to comment.