Skip to content

Commit

Permalink
Makefile: fix for pre-installed promu
Browse files Browse the repository at this point in the history
When using BUILD_PROMU=false, this fixes the circular dependency
warning promu->promu, and avoids trying to download promu binary
  • Loading branch information
pgier committed Jan 25, 2019
1 parent eb8f901 commit 727af12
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ GO ?= go
GOFMT ?= $(GO)fmt
FIRST_GOPATH := $(firstword $(subst :, ,$(shell $(GO) env GOPATH)))
ifeq ($(BUILD_PROMU),false)
PROMU := promu
PROMU := $(shell which promu)
else
PROMU := $(FIRST_GOPATH)/bin/promu
endif
Expand Down Expand Up @@ -199,11 +199,15 @@ common-docker-tag-latest:
promu: $(PROMU)

$(PROMU):
ifeq ($(BUILD_PROMU),false)
@echo "using installed promu: $(PROMU)"
else
$(eval PROMU_TMP := $(shell mktemp -d))
curl -s -L $(PROMU_URL) | tar -xvzf - -C $(PROMU_TMP)
mkdir -p $(FIRST_GOPATH)/bin
cp $(PROMU_TMP)/promu-$(PROMU_VERSION).$(GO_BUILD_PLATFORM)/promu $(FIRST_GOPATH)/bin/promu
rm -r $(PROMU_TMP)
endif

.PHONY: proto
proto:
Expand Down

0 comments on commit 727af12

Please sign in to comment.