@@ -69,6 +69,46 @@ $(PROTOC_GEN_GO):
69
69
go build -o " $@ " $(PROTOC_GEN_GO_PKG )
70
70
71
71
72
+ # #######################################################################
73
+ # # GEN-PROTO-GO ##
74
+ # #######################################################################
75
+
76
+ # This is the recipe for getting and installing the gen-proto pkg
77
+ # This is a dependency of grpc-go and must be installed before
78
+ # installing grpc-go.
79
+ GENPROTO_GO_SRC := github.com/googleapis/go-genproto
80
+ GENPROTO_GO_PKG := google.golang.org/genproto
81
+ GENPROTO_BUILD_GO := genproto-build-go
82
+ $(GENPROTO_BUILD_GO ) : GENPROTO_VERSION := 24fa4b261c55da65468f2abfdae2b024eef27dfb
83
+ $(GENPROTO_BUILD_GO ) :
84
+ mkdir -p $(dir $(GOPATH ) /src/$(GENPROTO_GO_PKG ) )
85
+ test -d $(GOPATH ) /src/$(GENPROTO_GO_PKG ) /.git || git clone https://$(GENPROTO_GO_SRC ) $(GOPATH ) /src/$(GENPROTO_GO_PKG )
86
+ (cd $( GOPATH) /src/$( GENPROTO_GO_PKG) && \
87
+ (git fetch && git checkout $( GENPROTO_VERSION) ))
88
+ (cd $( GOPATH) /src/$( GENPROTO_GO_PKG) && go get -v -d $$ (go list -f ' {{ .ImportPath }}' ./...))
89
+
90
+
91
+
92
+ # #######################################################################
93
+ # # GRPC-GO ##
94
+ # #######################################################################
95
+
96
+ # This is the recipe for getting and installing the grpc go
97
+ GRPC_GO_SRC := github.com/grpc/grpc-go
98
+ GRPC_GO_PKG := google.golang.org/grpc
99
+ GRPC_BUILD_GO := grpc-build-go
100
+ $(GRPC_BUILD_GO ) : GRPC_VERSION := v1.26.0
101
+ $(GRPC_BUILD_GO ) :
102
+ mkdir -p $(dir $(GOPATH ) /src/$(GRPC_GO_PKG ) )
103
+ test -d $(GOPATH ) /src/$(GRPC_GO_PKG ) /.git || git clone https://$(GRPC_GO_SRC ) $(GOPATH ) /src/$(GRPC_GO_PKG )
104
+ (cd $( GOPATH) /src/$( GRPC_GO_PKG) && \
105
+ (test " $$ (git describe --tags | head -1)" = " $( GRPC_VERSION) " || \
106
+ (git fetch && git checkout tags/$( GRPC_VERSION) )))
107
+ (cd $( GOPATH) /src/$( GRPC_GO_PKG) && go get -v -d $$ (go list -f ' {{ .ImportPath }}' ./...) && \
108
+ go build -o " $@ " $(GRPC_GO_PKG ) )
109
+
110
+
111
+
72
112
# #######################################################################
73
113
# # PATH ##
74
114
# #######################################################################
@@ -119,7 +159,7 @@ endif
119
159
# 1. Go get any missing dependencies.
120
160
# 2. Cache the packages.
121
161
# 3. Build the archive file.
122
- $(CSI_A ) : $(CSI_GO )
162
+ $(CSI_A ) : $(CSI_GO ) $( GENPROTO_BUILD_GO ) $( GRPC_BUILD_GO )
123
163
go get -v -d ./...
124
164
go install ./$(CSI_PKG_SUB )
125
165
go build -o " $@ " ./$(CSI_PKG_SUB )
@@ -133,4 +173,4 @@ clean:
133
173
clobber : clean
134
174
rm -fr " $( PROTOC) " " $( PROTOC_GEN_GO) " " $( CSI_PKG_SUB) "
135
175
136
- .PHONY : clean clobber
176
+ .PHONY : clean clobber $( GRPC_BUILD_GO ) $( GENPROTO_BUILD_GO )
0 commit comments