add go install to makefile for all binary
This commit is contained in:
parent
8353479476
commit
579ac0d2f3
9
Makefile
9
Makefile
@ -14,16 +14,25 @@ GOGET=$(GOCMD) get $(OPT_VERBOSE)
|
|||||||
SRCS := $(wildcard *.go)
|
SRCS := $(wildcard *.go)
|
||||||
# This is a substitution reference. http://www.gnu.org/software/make/manual/make.html#Substitution-Refs
|
# This is a substitution reference. http://www.gnu.org/software/make/manual/make.html#Substitution-Refs
|
||||||
BINS := $(SRCS:%.go=bin/%)
|
BINS := $(SRCS:%.go=bin/%)
|
||||||
|
INSTALLBINS := $(SRCS:%.go=$$GOPATH/bin/%)
|
||||||
|
|
||||||
all: $(BINS)
|
all: $(BINS)
|
||||||
|
install: $(INSTALLBINS)
|
||||||
|
|
||||||
$(BINS): bin/% : %.go | bin
|
$(BINS): bin/% : %.go | bin
|
||||||
@echo "constructing : $@"
|
@echo "constructing : $@"
|
||||||
@$(GOBUILD) -o "$@" "$^"
|
@$(GOBUILD) -o "$@" "$^"
|
||||||
|
|
||||||
|
$(INSTALLBINS): $$GOPATH/bin/% : %.go
|
||||||
|
@$(GOINSTALL) "$^"
|
||||||
|
|
||||||
|
bin:
|
||||||
|
@mkdir bin
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(GOCLEAN)
|
$(GOCLEAN)
|
||||||
rm -f ${GOPATH}/bin/$(PROGRAM_NAME)
|
rm -f ${GOPATH}/bin/$(PROGRAM_NAME)
|
||||||
|
|
||||||
get:
|
get:
|
||||||
$(GOGET) github.com/docker/docker-credential-helpers/client
|
$(GOGET) github.com/docker/docker-credential-helpers/client
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user