go version: check if go version is greater than 1.9.0 57/14057/1
authorClément Bénier <clement.benier@iot.bzh>
Mon, 21 May 2018 13:23:05 +0000 (15:23 +0200)
committerClément Bénier <clement.benier@iot.bzh>
Tue, 22 May 2018 07:35:58 +0000 (09:35 +0200)
Makefile checks if go version is greater than 1.9.0 if it is not the case an error
log advise to clear the glide cache with glide cc command.

Change-Id: If141a2b0972139a132f21c640affdf05869db2b5
Signed-off-by: Clément Bénier <clement.benier@iot.bzh>
Makefile

index 7c26883..2d2586e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -63,8 +63,9 @@ export PATH := $(PATH):$(LOCAL_TOOLSDIR)
 GOVERSION := $(shell go version |grep -o '[0-9\.]*'|head -n 1)
 GOVERMAJ := $(shell echo $(GOVERSION) |cut -f1 -d.)
 GOVERMIN := $(shell echo $(GOVERSION) |cut -f2 -d.)
 GOVERSION := $(shell go version |grep -o '[0-9\.]*'|head -n 1)
 GOVERMAJ := $(shell echo $(GOVERSION) |cut -f1 -d.)
 GOVERMIN := $(shell echo $(GOVERSION) |cut -f2 -d.)
-CHECKGOVER := $(shell [ $(GOVERMAJ) -gt 1 -o \( $(GOVERMAJ) -eq 1 -a $(GOVERMIN) -ge 8 \) ] && echo true)
-CHECKERRMSG := "ERROR: Go version 1.8.1 or higher is requested (current detected version: $(GOVERSION))."
+CHECKGOVER := $(shell [ $(GOVERMAJ) -gt 1 -o \( $(GOVERMAJ) -eq 1 -a $(GOVERMIN) -ge 9 \) ] && echo true)
+CHECKERRMSG := "ERROR: Go version 1.9.0 or higher is requested (current detected version: $(GOVERSION)). \n\
+\t--> It may be necessary to clear glide cache with following command 'tools/linux/glide cc'"
 
 
 VERBOSE_1 := -v
 
 
 VERBOSE_1 := -v
@@ -169,7 +170,7 @@ tools/glide:
 
 .PHONY:
 checkgover:
 
 .PHONY:
 checkgover:
-       @test "$(CHECKGOVER)" = "true" || { echo $(CHECKERRMSG); exit 1; }
+       @test "$(CHECKGOVER)" = "true" || { echo -e $(CHECKERRMSG); exit 1; }
 
 
 .PHONY: help
 
 
 .PHONY: help