diff options
author | Christian Svensson <blue@cmd.nu> | 2016-08-03 21:23:02 +0200 |
---|---|---|
committer | Christian Svensson <christian.svensson@tink.se> | 2016-12-22 00:38:47 +0100 |
commit | ee1a0cc3cc949b3745e8ed1a18e969f7d6944f82 (patch) | |
tree | aa0596dafb62d7cd9dcb254d5670988104b211eb | |
parent | 296d7fdd2e3bc48af436e733f029eaece8947d9a (diff) | |
download | prometheus_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.
-rw-r--r-- | Makefile | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -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 | ||
14 | GO := GO15VENDOREXPERIMENT=1 go | 14 | GO ?= GO15VENDOREXPERIMENT=1 go |
15 | PROMU := $(GOPATH)/bin/promu | 15 | PROMU ?= $(GOPATH)/bin/promu |
16 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) | 16 | pkgs = $(shell $(GO) list ./... | grep -v /vendor/) |
17 | 17 | ||
18 | PREFIX ?= $(shell pwd) | 18 | PREFIX ?= $(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 | ||
46 | build: promu | 46 | build: $(PROMU) |
47 | @echo ">> building binaries" | 47 | @echo ">> building binaries" |
48 | @$(PROMU) build --prefix $(PREFIX) | 48 | @$(PROMU) build --prefix $(PREFIX) |
49 | 49 | ||
50 | tarball: promu | 50 | tarball: $(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 | ||
58 | promu: | 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 |