From 3618aafca4597ee10349e7d7f3340305778fe500 Mon Sep 17 00:00:00 2001 From: Solly Ross Date: Mon, 26 Jun 2017 15:15:39 -0400 Subject: [PATCH] [build] fix build makefile target path The `build` Makefile target attempted to place the generated artifact in `/build`, where it should have used a local directory instead. This commit makes the directory configurable using the `OUT_DIR` argument, and defaults it to ./_output --- .gitignore | 2 +- Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c57f793b..69d2ba91 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ *.swp *~ vendor -./adapter +_output diff --git a/Makefile b/Makefile index 9fe211b6..b30779ad 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ TEMP_DIR:=$(shell mktemp -d) ARCH?=amd64 ALL_ARCH=amd64 arm arm64 ppc64le s390x ML_PLATFORMS=linux/amd64,linux/arm,linux/arm64,linux/ppc64le,linux/s390x +OUT_DIR?=./_output VERSION?=latest @@ -25,7 +26,7 @@ endif all: docker-build build: - CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o /build/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter + CGO_ENABLED=0 GOARCH=$(ARCH) go build -a -tags netgo -o $(OUT_DIR)/$(ARCH)/adapter github.com/directxman12/k8s-prometheus-adapter/cmd/adapter docker-build: cp deploy/Dockerfile $(TEMP_DIR)