2020-11-11 01:22:43 +00:00
|
|
|
.PHONY: all
|
|
|
|
|
|
|
|
#OPT_VERBOSE=-v
|
|
|
|
OPT_VERBOSE=
|
|
|
|
|
|
|
|
# Basic go commands
|
|
|
|
GOCMD=go
|
|
|
|
GOBUILD=$(GOCMD) build
|
|
|
|
GOCLEAN=$(GOCMD) clean
|
|
|
|
GOTEST=$(GOCMD) test
|
|
|
|
GOINSTALL=$(GOCMD) install $(OPT_VERBOSE)
|
|
|
|
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/%)
|
2020-11-11 01:37:01 +00:00
|
|
|
INSTALLBINS := $(SRCS:%.go=$$GOPATH/bin/%)
|
2020-11-11 01:22:43 +00:00
|
|
|
|
|
|
|
all: $(BINS)
|
2020-11-11 01:37:01 +00:00
|
|
|
install: $(INSTALLBINS)
|
2020-11-11 01:22:43 +00:00
|
|
|
|
2020-11-11 01:37:01 +00:00
|
|
|
$(BINS): bin/% : %.go | bin
|
2020-11-11 01:22:43 +00:00
|
|
|
@echo "constructing : $@"
|
|
|
|
@$(GOBUILD) -o "$@" "$^"
|
|
|
|
|
2020-11-11 01:37:01 +00:00
|
|
|
$(INSTALLBINS): $$GOPATH/bin/% : %.go
|
|
|
|
@$(GOINSTALL) "$^"
|
|
|
|
|
|
|
|
bin:
|
|
|
|
@mkdir bin
|
|
|
|
|
2020-11-11 01:22:43 +00:00
|
|
|
clean:
|
|
|
|
$(GOCLEAN)
|
|
|
|
rm -f ${GOPATH}/bin/$(PROGRAM_NAME)
|
|
|
|
|
|
|
|
get:
|
|
|
|
$(GOGET) github.com/docker/docker-credential-helpers/client
|
2020-11-11 01:37:01 +00:00
|
|
|
|