From 4f969006e66672435b36c68e9cce6d9c5368e4b8 Mon Sep 17 00:00:00 2001 From: Jeff Cheng Date: Mon, 12 Apr 2021 12:12:03 -0400 Subject: [PATCH] Add SKIP_COMPILE Makefile var --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 72c7414528..5e0bd00a72 100644 --- a/Makefile +++ b/Makefile @@ -43,6 +43,7 @@ BUILD_X3=-X $(BUILD_INFO_IMPORT_PATH).BuildType=$(BUILD_TYPE) BUILD_INFO=-ldflags "${BUILD_X1} ${BUILD_X2} ${BUILD_X3}" SMART_AGENT_RELEASE=v5.9.1 +SKIP_COMPILE=false ### FUNCTIONS @@ -189,7 +190,9 @@ delete-tag: .PHONY: docker-otelcol docker-otelcol: +ifneq ($(SKIP_COMPILE), true) GOOS=linux $(MAKE) otelcol +endif cp ./bin/otelcol_linux_amd64 ./cmd/otelcol/otelcol docker build -t otelcol --build-arg SMART_AGENT_RELEASE=$(SMART_AGENT_RELEASE) ./cmd/otelcol/ rm ./cmd/otelcol/otelcol @@ -216,6 +219,8 @@ binaries-windows_amd64: .PHONY: deb-rpm-package %-package: ARCH ?= amd64 %-package: +ifneq ($(SKIP_COMPILE), true) $(MAKE) binaries-linux_$(ARCH) +endif docker build -t otelcol-fpm internal/buildscripts/packaging/fpm docker run --rm -v $(CURDIR):/repo -e PACKAGE=$* -e VERSION=$(VERSION) -e ARCH=$(ARCH) -e SMART_AGENT_RELEASE=$(SMART_AGENT_RELEASE) otelcol-fpm