@@ -69,6 +69,24 @@ $(PROTOC_GEN_GO):
69
69
go build -o " $@ " $(PROTOC_GEN_GO_PKG )
70
70
71
71
72
+ # #######################################################################
73
+ # # GRPC-GO-PKG ##
74
+ # #######################################################################
75
+
76
+ # This is the recipe for getting and installing the grpc-go
77
+ GRPC_GO_PKG := github.com/grpc/grpc-go
78
+ GRPC_INSTALL_GO := grpc-go
79
+ $(GRPC_INSTALL_GO ) : GRPC_PKG := $(dir $(GRPC_GO_PKG ) )
80
+ $(GRPC_INSTALL_GO ) : GRPC_VERSION := v1.29.1
81
+ $(GRPC_INSTALL_GO ) :
82
+ mkdir -p $(dir $(GOPATH ) /src/$(GRPC_PKG ) )
83
+ test -d $(GOPATH ) /src/$(GRPC_PKG ) /.git || git clone https://$(GRPC_GO_PKG ) $(GOPATH ) /src/$(GRPC_PKG )
84
+ (cd $( GOPATH) /src/$( GRPC_PKG) && \
85
+ (test " $$ (git describe --tags | head -1)" = " $( GRPC_VERSION) " || \
86
+ (git fetch && git checkout tags/$( GRPC_VERSION) )))
87
+ (cd $( GOPATH) /src/$( GRPC_PKG) && go get -v -d $$ (go list -f ' {{ .ImportPath }}' ./...))
88
+
89
+
72
90
# #######################################################################
73
91
# # PATH ##
74
92
# #######################################################################
@@ -119,7 +137,7 @@ endif
119
137
# 1. Go get any missing dependencies.
120
138
# 2. Cache the packages.
121
139
# 3. Build the archive file.
122
- $(CSI_A ) : $(CSI_GO )
140
+ $(CSI_A ) : $(CSI_GO ) $( GRPC_INSTALL_GO )
123
141
go get -v -d ./...
124
142
go install ./$(CSI_PKG_SUB )
125
143
go build -o " $@ " ./$(CSI_PKG_SUB )
@@ -133,4 +151,4 @@ clean:
133
151
clobber : clean
134
152
rm -fr " $( PROTOC) " " $( PROTOC_GEN_GO) " " $( CSI_PKG_SUB) "
135
153
136
- .PHONY : clean clobber
154
+ .PHONY : clean clobber $( GRPC_INSTALL_GO )
0 commit comments