@@ -37,7 +37,7 @@ ifeq ($(OS), linux)
37
37
GTAR := tar
38
38
endif
39
39
40
- MDBOOK_EXTRACT_COMMAND := tar xfvz $(SHARE_DIR ) /mdbook.tar.gz -C bin
40
+ MDBOOK_EXTRACT_COMMAND := tar xfvz $(SHARE_DIR ) /mdbook.tar.gz -C $( BIN_DIR )
41
41
MDBOOK_ARCHIVE_EXT := .tar.gz
42
42
43
43
ifeq ($(OS ) , windows)
@@ -62,19 +62,19 @@ $(GTAR):
62
62
63
63
64
64
CONTROLLER_GEN := $(BIN_DIR ) /controller-gen
65
- $(CONTROLLER_GEN ) : $( BIN_DIR ) go.mod go.sum # Build controller-gen from tools folder.
65
+ $(CONTROLLER_GEN ) : go.mod go.sum | $( BIN_DIR ) # Build controller-gen from tools folder.
66
66
go build -tags=tools -o $@ sigs.k8s.io/controller-tools/cmd/controller-gen
67
67
68
68
CONVERSION_GEN := $(BIN_DIR ) /conversion-gen
69
- $(CONVERSION_GEN ) : $( BIN_DIR ) go.mod go.sum
69
+ $(CONVERSION_GEN ) : go.mod go.sum | $( BIN_DIR )
70
70
go build -tags=tools -o $@ k8s.io/code-generator/cmd/conversion-gen
71
71
72
72
DEFAULTER_GEN := $(BIN_DIR ) /defaulter-gen
73
- $(DEFAULTER_GEN ) : $( BIN_DIR ) go.mod go.sum
73
+ $(DEFAULTER_GEN ) : go.mod go.sum | $( BIN_DIR )
74
74
go build -tags=tools -o $@ k8s.io/code-generator/cmd/defaulter-gen
75
75
76
76
ENVSUBST := $(BIN_DIR ) /envsubst
77
- $(ENVSUBST ) : $( BIN_DIR ) go.mod go.sum # Build envsubst from tools folder.
77
+ $(ENVSUBST ) : go.mod go.sum | $( BIN_DIR ) # Build envsubst from tools folder.
78
78
go build -tags=tools -o $@ github.com/a8m/envsubst/cmd/envsubst
79
79
80
80
GH_SHARE := $(SHARE_DIR ) /gh
@@ -86,63 +86,63 @@ $(GH_SHARE)/gh.tar.gz: $(GH_SHARE)
86
86
curl -L " https://github.com/cli/cli/releases/download/v$( GH_VERSION) /gh_$( GH_VERSION) _$( GH_ARCH_SUFFIX) .tar.gz" -o $@
87
87
88
88
GH := $(BIN_DIR ) /gh
89
- GH : $(GTAR ) $(GH_SHARE ) /gh.tar.gz
90
- $(GTAR ) -xvf share /gh/gh.tar.gz gh_$(GH_VERSION ) _$(GH_ARCH_SUFFIX ) /bin/gh --strip-components 1 --directory $(BIN_DIR )
89
+ $( GH ) : $(GTAR ) $(GH_SHARE ) /gh.tar.gz | $( BIN_DIR )
90
+ $(GTAR ) -xvf $( SHARE_DIR ) /gh/gh.tar.gz gh_$(GH_VERSION ) _$(GH_ARCH_SUFFIX ) /bin/gh --strip-components 1 --directory $(BIN_DIR )
91
91
chmod +x $@
92
92
touch -m $@
93
93
94
94
GINKGO := $(BIN_DIR ) /ginkgo
95
- $(GINKGO ) : $( BIN_DIR ) go.mod go.sum
95
+ $(GINKGO ) : go.mod go.sum | $( BIN_DIR )
96
96
go build -tags=tools -o $@ github.com/onsi/ginkgo/v2/ginkgo
97
97
98
98
GOJQ := $(BIN_DIR ) /gojq
99
- $(GOJQ ) : $( BIN_DIR ) go.mod go.sum
99
+ $(GOJQ ) : go.mod go.sum | $( BIN_DIR )
100
100
go build -tags=tools -o $@ github.com/itchyny/gojq/cmd/gojq
101
101
102
102
GOLANGCI_LINT := $(BIN_DIR ) /golangci-lint
103
103
$(GOLANGCI_LINT ) : Makefile ensure-golangci-lint.sh | $(BIN_DIR )
104
104
./ensure-golangci-lint.sh -b $(BIN_DIR ) $(GOLANGCI_LINT_VERSION )
105
105
106
106
KUSTOMIZE := $(BIN_DIR ) /kustomize
107
- $(KUSTOMIZE ) : $( BIN_DIR ) go.mod go.sum # Build kustomize from tools folder.
107
+ $(KUSTOMIZE ) : go.mod go.sum | $( BIN_DIR ) # Build kustomize from tools folder.
108
108
CGO_ENABLED=0 go build -tags=tools -o $@ sigs.k8s.io/kustomize/kustomize/v4
109
109
110
110
MDBOOK_SHARE := $(SHARE_DIR ) /mdbook$(MDBOOK_ARCHIVE_EXT )
111
111
$(MDBOOK_SHARE ) : ../../versions.mk $(SHARE_DIR )
112
112
curl -sL -o $(MDBOOK_SHARE ) " https://github.com/rust-lang/mdBook/releases/download/$( MDBOOK_VERSION) /mdBook-$( MDBOOK_VERSION) -x86_64-$( RUST_TARGET) $( MDBOOK_ARCHIVE_EXT) "
113
113
114
114
MDBOOK := $(BIN_DIR ) /mdbook
115
- $(MDBOOK ) : $(BIN_DIR ) $( MDBOOK_SHARE )
115
+ $(MDBOOK ) : $(MDBOOK_SHARE ) | $( BIN_DIR )
116
116
$(MDBOOK_EXTRACT_COMMAND )
117
117
chmod +x $@
118
118
touch -m $@
119
119
120
120
MDBOOK_EMBED := $(BIN_DIR ) /mdbook-embed
121
- $(MDBOOK_EMBED ) : $( BIN_DIR ) go.mod go.sum
121
+ $(MDBOOK_EMBED ) : go.mod go.sum | $( BIN_DIR )
122
122
go build -tags=tools -o $(BIN_DIR ) /mdbook-embed sigs.k8s.io/cluster-api/hack/tools/mdbook/embed
123
123
124
124
MDBOOK_RELEASELINK := $(BIN_DIR ) /mdbook-releaselink
125
- $(MDBOOK_RELEASELINK ) : $( BIN_DIR ) go.mod go.sum
125
+ $(MDBOOK_RELEASELINK ) : go.mod go.sum | $( BIN_DIR )
126
126
go build -tags=tools -o $(BIN_DIR ) /mdbook-releaselink sigs.k8s.io/cluster-api/hack/tools/mdbook/releaselink
127
127
128
128
MDBOOK_TABULATE := $(BIN_DIR ) /mdbook-tabulate
129
- $(MDBOOK_TABULATE ) : $( BIN_DIR ) go.mod go.sum
129
+ $(MDBOOK_TABULATE ) : go.mod go.sum | $( BIN_DIR )
130
130
go build -tags=tools -o $(BIN_DIR ) /mdbook-tabulate sigs.k8s.io/cluster-api/hack/tools/mdbook/tabulate
131
131
132
132
MOCKGEN := $(BIN_DIR ) /mockgen
133
- $(MOCKGEN ) : $( BIN_DIR ) go.mod go.sum # Build mockgen from tools folder.
133
+ $(MOCKGEN ) : go.mod go.sum | $( BIN_DIR ) # Build mockgen from tools folder.
134
134
go build -tags=tools -o $@ github.com/golang/mock/mockgen
135
135
136
136
RELEASE_NOTES := $(BIN_DIR ) /release-notes
137
- $(RELEASE_NOTES ) : $( BIN_DIR ) go.mod go.sum
137
+ $(RELEASE_NOTES ) : go.mod go.sum | $( BIN_DIR )
138
138
go build -tags tools -o $@ sigs.k8s.io/cluster-api/hack/tools/release
139
139
140
140
PLANTUML := $(BIN_DIR ) /plantuml-sentinal
141
- $(PLANTUML ) : plantuml.Dockerfile ../../versions.mk
141
+ $(PLANTUML ) : plantuml.Dockerfile ../../versions.mk | $( BIN_DIR )
142
142
docker build --build-arg PLANTUML_VERSION=$(PLANTUML_VERSION ) . -f plantuml.Dockerfile -t " plantuml-builder"
143
143
touch $@
144
144
145
145
.PHONY : clean
146
146
clean : # # Remove all tools
147
- rm -rf bin
148
- rm -rf share
147
+ rm -rf $( BIN_DIR )
148
+ rm -rf $( SHARE_DIR )
0 commit comments