forked from kubernetes/test-infra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (77 loc) · 2.92 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
70
71
72
73
74
75
76
77
78
# Copyright 2021 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################
# ========================== Capture Environment ===============================
# get the repo root and output path
REPO_ROOT:=${CURDIR}
OUT_DIR=$(REPO_ROOT)/_output
################################################################################
# ========================= Setup Go With Gimme ================================
# go version to use for build etc.
# go1.9+ can autodetect GOROOT, but if some other tool sets it ...
GOROOT:=
# enable modules
GO111MODULE=on
export PATH GOROOT GO111MODULE
# work around broken PATH export
SPACE:=$(subst ,, )
SHELL:=env PATH=$(subst $(SPACE),\$(SPACE),$(PATH)) $(SHELL)
################################################################################
# ================================= Testing ====================================
# unit tests (hermetic)
unit:
hack/make-rules/go-test/unit.sh
# integration tests
# integration:
# hack/make-rules/go-test/integration.sh
# all tests
test: unit
################################################################################
# ================================= Cleanup ====================================
# standard cleanup target
clean:
rm -rf "$(OUT_DIR)/"
################################################################################
# ============================== Auto-Update ===================================
# update generated code, gofmt, etc.
# update:
# hack/make-rules/update/all.sh
# update generated code
#generate:
# hack/make-rules/update/generated.sh
# gofmt
#gofmt:
# hack/make-rules/update/gofmt.sh
################################################################################
# ================================== Linting ===================================
# run linters, ensure generated code, etc.
verify:
hack/make-rules/verify/all.sh
# go linters
go-lint:
hack/make-rules/verify/golangci-lint.sh
update-gofmt:
hack/make-rules/update/gofmt.sh
verify-gofmt:
hack/make-rules/verify/gofmt.sh
update-file-perms:
hack/make-rules/update/file-perms.sh
verify-file-perms:
hack/make-rules/verify/file-perms.sh
update-spelling:
hack/make-rules/update/misspell.sh
verify-spelling:
hack/make-rules/verify/misspell.sh
#################################################################################
.PHONY: unit test verify go-lint update-gofmt verify-gofmt update-spelling verify-spelling