/
Makefile
39 lines (27 loc) · 1019 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.DEFAULT_GOAL := help
.PHONY: help
BINARY=k8guard-report
VERSION=`git fetch;git describe --tags > /dev/null 2>&1`
BUILD=`date +%FT%T%z`
LDFLAGS=-ldflags "-X views.Version=${VERSION} -X views.Build=${BUILD}"
create-pre-commit-hooks: ## creates pre-commit hooks
chmod +x $(CURDIR)/hooks/pre-commit
ln -s $(CURDIR)/hooks/pre-commit .git/hooks/pre-commit || true
deps: ## install dependencies
glide install
glide-update:
glide cc
glide update
build-docker:
docker build -t local/k8guard-report .
build: ## builds binary for linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY}
mac: ## builds binary for mac
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o ${BINARY}
clean: ## cleans binary
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
go clean
sclean: clean ## super clean, cleans binary and glide lock
rm glide.lock
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'