add make install support

This commit is contained in:
Benjamin Elder
2019-05-07 21:25:51 -07:00
parent c9fe6224b3
commit f9debfdc6f
2 changed files with 54 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ REPO_ROOT=$(PWD)
# autodetect host GOOS and GOARCH by default, even if go is not installed
GOOS=$(shell hack/util/goos.sh)
GOARCH=$(shell hack/util/goarch.sh)
INSTALL_DIR=$(shell hack/util/goinstalldir.sh)
# use the official module proxy by default
GOPROXY=https://proxy.golang.org
# default build image
@@ -31,6 +32,7 @@ CACHE_VOLUME=kind-build-cache
# variables for consistent logic, don't override these
CONTAINER_REPO_DIR=/src/kind
CONTAINER_OUT_DIR=$(CONTAINER_REPO_DIR)/_output/bin
HOST_OUT_DIR=$(REPO_ROOT)/_output/bin
# standard "make" target -> builds
all: build
@@ -62,7 +64,11 @@ kind: make-cache
# alias for building kind
build: kind
# use: make install INSTALL_DIR=/usr/local/bin
install: build
cp $(HOST_OUT_DIR)/kind $(INSTALL_DIR)/kind
# standard cleanup target
clean: clean-cache
.PHONY: make-cache clean-cache kind build all clean
.PHONY: all make-cache clean-cache kind build install clean