From 3685fc18d58683ee7555ac7c16672eeef22a94b6 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 28 Aug 2019 01:34:26 +0300 Subject: [PATCH] Makefile: extract `app-local` and `app-local-pure` build rules --- Makefile | 6 ++++++ app/victoria-metrics/Makefile | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4f7095fc2..510eb1736 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,12 @@ vendor-update: GO111MODULE=on go mod tidy GO111MODULE=on go mod vendor +app-local: + CGO_ENABLED=1 GO111MODULE=on go build $(RACE) -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/$(APP_NAME)$(RACE) $(PKG_PREFIX)/app/$(APP_NAME) + +app-local-pure: + CGO_ENABLED=0 GO111MODULE=on go build $(RACE) -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/$(APP_NAME)-pure$(RACE) $(PKG_PREFIX)/app/$(APP_NAME) + quicktemplate-gen: install-qtc qtc diff --git a/app/victoria-metrics/Makefile b/app/victoria-metrics/Makefile index 06139f75d..834e09242 100644 --- a/app/victoria-metrics/Makefile +++ b/app/victoria-metrics/Makefile @@ -1,10 +1,7 @@ # All these commands must run from repository root. victoria-metrics: - APP_NAME=victoria-metrics $(MAKE) app-via-host-builder - -app-via-host-builder: - GO111MODULE=on go build -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/victoria-metrics ./app/victoria-metrics + APP_NAME=victoria-metrics $(MAKE) app-local victoria-metrics-prod: APP_NAME=victoria-metrics $(MAKE) app-via-docker @@ -36,7 +33,7 @@ victoria-metrics-arm64-prod: APP_NAME=victoria-metrics APP_SUFFIX='-arm64' DOCKER_OPTS='--env CGO_ENABLED=0 --env GOARCH=arm64' $(MAKE) app-via-docker victoria-metrics-pure: - GO111MODULE=on CGO_ENABLED=0 go build -mod=vendor -ldflags "$(GO_BUILDINFO)" -o bin/victoria-metrics-pure ./app/victoria-metrics + APP_NAME=victoria-metrics $(MAKE) app-local-pure victoria-metrics-pure-prod: APP_NAME=victoria-metrics APP_SUFFIX='-pure' DOCKER_OPTS='--env CGO_ENABLED=0' $(MAKE) app-via-docker