From 16b12150b6146a4d71e18a1e835d0e77236fc5d2 Mon Sep 17 00:00:00 2001 From: Aya Igarashi Date: Sat, 18 May 2019 10:38:41 +0900 Subject: [PATCH] Add Makefile --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a63ed30 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +REPO_NAME=kubectl-bindrole +PKGROOT=github.com/Ladicle/kubectl-bindrole +VERSION ?= $(shell git rev-parse --short HEAD) +OUTDIR=_output + +build: + GO111MODULE=on CGO_ENABLED=0 go build -ldflags "-w -X $(PKGROOT)/cmd.version=$(VERSION) -X $(PKGROOT)/cmd.command=$(REPO_NAME)" -o $(OUTDIR)/kubectl-bindrole +install: + GO111MODULE=on CGO_ENABLED=0 go install -ldflags "-w -X $(PKGROOT)/cmd.version=$(VERSION) -X $(PKGROOT)/cmd.command=$(REPO_NAME)" +check: + GO111MODULE=on go vet $(PKGROOT)/... + ./test + +.PHONY: clean +clean: + -rm -r $(OUTDIR)