@@ -82,6 +82,33 @@ all: generate test operator
82
82
help : # # Display this help
83
83
@awk ' BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[0-9A-Za-z_-]+:.*?##/ { printf " \033[36m%-45s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST )
84
84
85
+ # # --------------------------------------
86
+ # # Hack / Tools
87
+ # # --------------------------------------
88
+
89
+ kustomize : $(KUSTOMIZE ) # # Build a local copy of kustomize.
90
+ go-apidiff : $(GO_APIDIFF ) # # Build a local copy of apidiff
91
+
92
+ $(CONTROLLER_GEN ) : $(TOOLS_DIR ) /go.mod # Build controller-gen from tools folder.
93
+ cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
94
+
95
+ $(KUSTOMIZE ) : # Build kustomize from tools folder.
96
+ $(ROOT ) /hack/ensure-kustomize.sh
97
+
98
+ $(SETUP_ENVTEST ) : $(TOOLS_DIR ) /go.mod # Build setup-envtest from tools folder.
99
+ cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
100
+
101
+ $(GOTESTSUM ) : $(TOOLS_DIR ) /go.mod # Build gotestsum from tools folder.
102
+ cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /gotestsum gotest.tools/gotestsum
103
+
104
+ $(GOLANGCI_LINT ) : .github/workflows/golangci-lint.yml # Download golanci-lint using hack script into tools folder.
105
+ hack/ensure-golangci-lint.sh \
106
+ -b $(TOOLS_DIR ) /$(BIN_DIR ) \
107
+ $(shell cat .github/workflows/golangci-lint.yml | grep version | sed 's/.* version: //')
108
+
109
+ $(GO_APIDIFF ) : $(TOOLS_DIR ) /go.mod # Build go-apidiff from tools folder.
110
+ cd $(TOOLS_DIR ) && go build -tags=tools -o $(GO_APIDIFF_BIN ) github.com/joelanford/go-apidiff
111
+
85
112
# # --------------------------------------
86
113
# # Testing
87
114
# # --------------------------------------
@@ -112,28 +139,6 @@ test-junit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run tests with verbose setting and
112
139
operator : # # Build operator binary
113
140
go build -trimpath -ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /operator sigs.k8s.io/cluster-api-operator
114
141
115
- $(CONTROLLER_GEN ) : $(TOOLS_DIR ) /go.mod # Build controller-gen from tools folder.
116
- cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /controller-gen sigs.k8s.io/controller-tools/cmd/controller-gen
117
-
118
- $(KUSTOMIZE ) : # Build kustomize from tools folder.
119
- $(ROOT ) /hack/ensure-kustomize.sh
120
-
121
- $(SETUP_ENVTEST ) : $(TOOLS_DIR ) /go.mod # Build setup-envtest from tools folder.
122
- cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
123
-
124
- $(GOTESTSUM ) : $(TOOLS_DIR ) /go.mod # Build gotestsum from tools folder.
125
- cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /gotestsum gotest.tools/gotestsum
126
-
127
- $(GOLANGCI_LINT ) : .github/workflows/golangci-lint.yml # Download golanci-lint using hack script into tools folder.
128
- hack/ensure-golangci-lint.sh \
129
- -b $(TOOLS_DIR ) /$(BIN_DIR ) \
130
- $(shell cat .github/workflows/golangci-lint.yml | grep version | sed 's/.* version: //')
131
-
132
- $(GO_APIDIFF ) : $(TOOLS_DIR ) /go.mod # Build go-apidiff from tools folder.
133
- cd $(TOOLS_DIR ) && go build -tags=tools -o $(GO_APIDIFF_BIN ) github.com/joelanford/go-apidiff
134
-
135
- kustomize : $(KUSTOMIZE ) # # Build a local copy of kustomize.
136
-
137
142
# # --------------------------------------
138
143
# # Lint / Verify
139
144
# # --------------------------------------
0 commit comments