@@ -20,18 +20,18 @@ GOPATH ?= /tmp/go
2020
2121UNAME_S := $(shell uname -s)
2222ifeq ($(UNAME_S ) ,Linux)
23- SHASUM := " sha256sum -c"
23+ SHASUM := sha256sum -c
2424 DEP_URL := https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64
2525 DEP_HASH := 31144e465e52ffbc0035248a10ddea61a09bf28b00784fd3fdd9882c8cbb2315
26- GORELEASER_URL := https://github.com/goreleaser/goreleaser/releases/download/v0.54 .0/goreleaser_Linux_x86_64.tar.gz
27- GORELEASER_HASH := 895df4293580dd8f9b0daf0ef5456f2238a2fbfc51d9f75dde6e2c63ca4fccc2
26+ GORELEASER_URL := https://github.com/goreleaser/goreleaser/releases/download/v0.77 .0/goreleaser_Linux_x86_64.tar.gz
27+ GORELEASER_HASH := aae3c5bb76b282e29940f2654b48b13e51f664368c7589d0e86b391b7ef51cc8
2828endif
2929ifeq ($(UNAME_S ) ,Darwin)
30- SHASUM := " shasum -a 256 -c"
30+ SHASUM := shasum -a 256 -c
3131 DEP_URL := https://github.com/golang/dep/releases/download/v0.4.1/dep-darwin-amd64
32- DEP_HASH := f170008e2bf8b196779c361a4eaece1b03450d23bbf32d1a0beaa9b00b6a5ab4
33- GORELEASER_URL := https://github.com/goreleaser/goreleaser/releases/download/v0.54 .0/goreleaser_Darwin_x86_64.tar.gz
34- GORELEASER_HASH := 9d927528a599174eed4d0d6a1ce6bdc810463c4cb105b0d2319c7c63ec642c9b
32+ DEP_HASH := 1544afdd4d543574ef8eabed343d683f7211202a65380f8b32035d07ce0c45ef
33+ GORELEASER_URL := https://github.com/goreleaser/goreleaser/releases/download/v0.77 .0/goreleaser_Darwin_x86_64.tar.gz
34+ GORELEASER_HASH := bc6cdf2dfe506f2cce5abceb30da009bfd5bcdb3e52608c536e6c2ceea1f24fe
3535endif
3636
3737
@@ -124,15 +124,29 @@ $(BINDIR)/informer-gen:
124124
125125$(BINDIR ) /dep :
126126 curl -sL -o $@ $(DEP_URL )
127- echo " $( DEP_HASH) $@ " | $$ SHASUM
127+ echo " $( DEP_HASH) $@ " | $( SHASUM )
128128 chmod +x $@
129129
130+ # upx binary packer, only supported on Linux
131+ $(BINDIR ) /upx :
132+ ifeq ($(UNAME_S ) ,Linux)
133+ curl -sL -o
[email protected] https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
134+ echo "e1fc0d55c88865ef758c7e4fabbc439e4b5693b9328d219e0b9b3604186abe20
[email protected] " | $(SHASUM)
135+ which xz || ( apt-get update && apt-get -y install xz-utils)
136+ cd $(BINDIR) && tar xvf $(shell basename $@).tar.xz upx-3.94-amd64_linux/upx --strip-components=1
137+ 138+ else
139+ echo -e "# /bin/sh\nexit 0" > $@
140+ chmod +x $@
141+ endif
142+
130143$(BINDIR ) /goreleaser :
131144 curl -sL -o $@ .tar.gz $(GORELEASER_URL )
132- echo " $( GORELEASER_HASH) $@ .tar.gz" | $$ SHASUM
145+ echo " $( GORELEASER_HASH) $@ .tar.gz" | $( SHASUM )
133146 cd $(BINDIR ) && tar xzvf $(shell basename $@ ) .tar.gz goreleaser
147+ rm $@ .tar.gz
134148
135- depend : $(BINDIR ) /go-bindata $(BINDIR ) /mockgen $(BINDIR ) /defaulter-gen $(BINDIR ) /defaulter-gen $(BINDIR ) /deepcopy-gen $(BINDIR ) /conversion-gen $(BINDIR ) /client-gen $(BINDIR ) /lister-gen $(BINDIR ) /informer-gen $(BINDIR ) /dep $(BINDIR ) /goreleaser
149+ depend : $(BINDIR ) /go-bindata $(BINDIR ) /mockgen $(BINDIR ) /defaulter-gen $(BINDIR ) /defaulter-gen $(BINDIR ) /deepcopy-gen $(BINDIR ) /conversion-gen $(BINDIR ) /client-gen $(BINDIR ) /lister-gen $(BINDIR ) /informer-gen $(BINDIR ) /dep $(BINDIR ) /goreleaser $( BINDIR ) /upx
136150
137151go_generate : depend
138152 go generate $$(go list ./pkg/... ./cmd/... )
0 commit comments