add go install to makefile for all binary

This commit is contained in:
Antoine 2020-11-11 02:37:01 +01:00
parent 8353479476
commit 579ac0d2f3
Signed by: antoine
GPG Key ID: 098FB66FC0475E70
1 changed files with 10 additions and 1 deletions

View File

@ -14,16 +14,25 @@ GOGET=$(GOCMD) get $(OPT_VERBOSE)
SRCS := $(wildcard *.go)
# This is a substitution reference. http://www.gnu.org/software/make/manual/make.html#Substitution-Refs
BINS := $(SRCS:%.go=bin/%)
INSTALLBINS := $(SRCS:%.go=$$GOPATH/bin/%)
all: $(BINS)
install: $(INSTALLBINS)
$(BINS) : bin/% : %.go | bin
$(BINS): bin/% : %.go | bin
@echo "constructing : $@"
@$(GOBUILD) -o "$@" "$^"
$(INSTALLBINS): $$GOPATH/bin/% : %.go
@$(GOINSTALL) "$^"
bin:
@mkdir bin
clean:
$(GOCLEAN)
rm -f ${GOPATH}/bin/$(PROGRAM_NAME)
get:
$(GOGET) github.com/docker/docker-credential-helpers/client