From a2c4da068f535a2ad81572e98a1f7d3bea07e495 Mon Sep 17 00:00:00 2001 From: Simon Pasquier Date: Wed, 13 Mar 2019 09:14:47 +0100 Subject: [PATCH] Update Makefile.common Signed-off-by: Simon Pasquier --- Makefile | 9 ++------- Makefile.common | 10 +++++++++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 443c360..b25fb83 100644 --- a/Makefile +++ b/Makefile @@ -20,13 +20,8 @@ STATICCHECK_IGNORE = \ github.com/prometheus/client_golang/prometheus/promhttp/instrument_server_test.go:SA1019 \ github.com/prometheus/client_golang/prometheus/http.go:SA1019 -.PHONY: get_dep -get_dep: - @echo ">> getting dependencies" - $(GO) get -t ./... - .PHONY: test -test: get_dep common-test +test: deps common-test .PHONY: test-short -test-short: get_dep common-test-short +test-short: deps common-test-short diff --git a/Makefile.common b/Makefile.common index 7105cff..108e494 100644 --- a/Makefile.common +++ b/Makefile.common @@ -116,6 +116,15 @@ common-check_license: exit 1; \ fi +.PHONY: common-deps +common-deps: + @echo ">> getting dependencies" +ifdef GO111MODULE + GO111MODULE=$(GO111MODULE) $(GO) mod download +else + $(GO) get $(GOOPTS) -t ./... +endif + .PHONY: common-test-short common-test-short: @echo ">> running short tests" @@ -221,7 +230,6 @@ precheck:: define PRECHECK_COMMAND_template = precheck:: $(1)_precheck - PRECHECK_COMMAND_$(1) ?= $(1) $$(strip $$(PRECHECK_OPTIONS_$(1))) .PHONY: $(1)_precheck $(1)_precheck: