aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Svensson <blue@cmd.nu>2016-08-03 21:23:02 +0200
committerChristian Svensson <christian.svensson@tink.se>2016-12-22 00:38:47 +0100
commitee1a0cc3cc949b3745e8ed1a18e969f7d6944f82 (patch)
treeaa0596dafb62d7cd9dcb254d5670988104b211eb /Makefile
parent296d7fdd2e3bc48af436e733f029eaece8947d9a (diff)
downloadprometheus_node_collector-ee1a0cc3cc949b3745e8ed1a18e969f7d6944f82.tar.bz2
prometheus_node_collector-ee1a0cc3cc949b3745e8ed1a18e969f7d6944f82.tar.xz
prometheus_node_collector-ee1a0cc3cc949b3745e8ed1a18e969f7d6944f82.zip
Allow overrides for GO and PROMU
This allows the user to override how/where promu and/or go is invoked.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index a854240..a02a842 100644
--- a/Makefile
+++ b/Makefile
@@ -11,8 +11,8 @@
11# See the License for the specific language governing permissions and 11# See the License for the specific language governing permissions and
12# limitations under the License. 12# limitations under the License.
13 13
14GO := GO15VENDOREXPERIMENT=1 go 14GO ?= GO15VENDOREXPERIMENT=1 go
15PROMU := $(GOPATH)/bin/promu 15PROMU ?= $(GOPATH)/bin/promu
16pkgs = $(shell $(GO) list ./... | grep -v /vendor/) 16pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
17 17
18PREFIX ?= $(shell pwd) 18PREFIX ?= $(shell pwd)
@@ -43,11 +43,11 @@ vet:
43 @echo ">> vetting code" 43 @echo ">> vetting code"
44 @$(GO) vet $(pkgs) 44 @$(GO) vet $(pkgs)
45 45
46build: promu 46build: $(PROMU)
47 @echo ">> building binaries" 47 @echo ">> building binaries"
48 @$(PROMU) build --prefix $(PREFIX) 48 @$(PROMU) build --prefix $(PREFIX)
49 49
50tarball: promu 50tarball: $(PROMU)
51 @echo ">> building release tarball" 51 @echo ">> building release tarball"
52 @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR) 52 @$(PROMU) tarball --prefix $(PREFIX) $(BIN_DIR)
53 53
@@ -55,10 +55,10 @@ docker:
55 @echo ">> building docker image" 55 @echo ">> building docker image"
56 @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" . 56 @docker build -t "$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)" .
57 57
58promu: 58$(GOPATH)/bin/promu promu:
59 @GOOS=$(shell uname -s | tr A-Z a-z) \ 59 @GOOS=$(shell uname -s | tr A-Z a-z) \
60 GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \ 60 GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
61 $(GO) get -u github.com/prometheus/promu 61 $(GO) get -u github.com/prometheus/promu
62 62
63 63
64.PHONY: all style format build test test-e2e vet tarball docker promu 64.PHONY: all style format build test test-e2e vet tarball docker promu $(GOPATH)/bin/promu