-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
69 lines (47 loc) · 1.08 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
SHELL := bash
TESTARGS_DEFAULT := "-v"
export TESTARGS ?= $(TESTARGS_DEFAULT)
HAS_LINT := $(shell command -v golint;)
GOOS ?= $(shell go env GOOS)
LDFLAGS := $(shell source ./hack/version.sh; version::ldflags)
# CTI targets
build: manager
manager:
CGO_ENABLED=0 GOOS=$(GOOS) go build \
-ldflags "${LDFLAGS}" \
-o machine-controller-manager \
cmd/manager/main.go
test: ## Run tests
@echo -e "\033[32mTesting...\033[0m"
hack/ci-test.sh
check: fmt vet lint
unit:
go test -tags=unit $(shell go list ./...) $(TESTARGS)
.PHONY: check-vendor
check-vendor:
hack/verify-vendor.sh
fmt:
hack/verify-gofmt.sh
update:
hack/update-gofmt.sh
lint:
ifndef HAS_LINT
go get -u golang.org/x/lint/golint
echo "installing golint"
endif
hack/verify-golint.sh
vet:
go vet ./...
cover:
go test -tags=unit $(shell go list ./...) -cover
clean:
rm -rf _dist bin/manager
realclean: clean
rm -rf vendor
if [ "$(GOPATH)" = "$(GOPATH_DEFAULT)" ]; then \
rm -rf $(GOPATH); \
fi
version:
@echo ${VERSION}
.PHONY: build clean cover docs fmt lint realclean \
test translation version unit