diff --git a/Makefile b/Makefile index e7d611eca5b..916804b4a6d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ ### Makefile for tiflow -.PHONY: build test check clean fmt cdc cdc_fips kafka_consumer storage_consumer coverage \ +.PHONY: build test check clean fmt cdc kafka_consumer storage_consumer coverage \ integration_test_build integration_test integration_test_mysql integration_test_kafka bank \ kafka_docker_integration_test kafka_docker_integration_test_with_build \ clean_integration_test_containers \ @@ -58,8 +58,13 @@ else ifeq (${OS}, "darwin") CGO := 1 endif -GOBUILD := CGO_ENABLED=$(CGO) $(GO) build $(BUILD_FLAG) -trimpath $(GOVENDORFLAG) -GOBUILDFIPS := CGO_ENABLED=1 GOEXPERIMENT=boringcrypto $(GO) build -tags boringcrypto $(BUILD_FLAG) -trimpath $(GOVENDORFLAG) +BUILD_FLAG = +GOEXPERIMENT= +ifeq ("${ENABLE_FIPS}", "1") + BUILD_FLAG = -tags boringcrypto + GOEXPERIMENT = GOEXPERIMENT=boringcrypto +endif +GOBUILD := $(GOEXPERIMENT) CGO_ENABLED=$(CGO) $(GO) build $(BUILD_FLAG) -trimpath $(GOVENDORFLAG) GOBUILDNOVENDOR := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) -trimpath GOTEST := CGO_ENABLED=1 $(GO) test -p $(P) --race --tags=intest GOTESTNORACE := CGO_ENABLED=1 $(GO) test -p $(P) @@ -156,10 +161,7 @@ build-cdc-with-failpoint: ## Build cdc with failpoint enabled. $(FAILPOINT_DISABLE) cdc: - $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/cdc ./cmd/cdc/main.go - -cdc_fips: - $(GOBUILDFIPS) -ldflags '$(LDFLAGS)' -o bin/cdc ./cmd/cdc + $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/cdc ./cmd/cdc kafka_consumer: $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/cdc_kafka_consumer ./cmd/kafka-consumer/main.go