test/Makefile

39 lines
739 B
Makefile

.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/%)
INSTALLBINS := $(SRCS:%.go=$$GOPATH/bin/%)
all: $(BINS)
install: $(INSTALLBINS)
$(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