From c76a3ba874c94240f76c83dacd264d60e3e3fb36 Mon Sep 17 00:00:00 2001 From: chengzhinei Date: Tue, 16 May 2023 10:45:21 +0800 Subject: [PATCH] support pgo --- Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 8105313f32..936b29b449 100644 --- a/Makefile +++ b/Makefile @@ -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) @@ -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