From 579ac0d2f3c7e1a6c5220444dd4479d03161a616 Mon Sep 17 00:00:00 2001 From: Antoine Date: Wed, 11 Nov 2020 02:37:01 +0100 Subject: [PATCH] add go install to makefile for all binary --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6f5d44b..9efeb70 100644 --- a/Makefile +++ b/Makefile @@ -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 +