@@ -179,15 +179,15 @@ kind-cluster: ## Create a new kind cluster designed for testing with Tilt
179
179
180
180
.PHONY : manager-core
181
181
manager-core : # # Build core manager binary
182
- go build -ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /manager sigs.k8s.io/cluster-api
182
+ go build -trimpath - ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /manager sigs.k8s.io/cluster-api
183
183
184
184
.PHONY : manager-kubeadm-bootstrap
185
185
manager-kubeadm-bootstrap : # # Build kubeadm bootstrap manager
186
- go build -ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /kubeadm-bootstrap-manager sigs.k8s.io/cluster-api/bootstrap/kubeadm
186
+ go build -trimpath - ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /kubeadm-bootstrap-manager sigs.k8s.io/cluster-api/bootstrap/kubeadm
187
187
188
188
.PHONY : manager-kubeadm-control-plane
189
189
manager-kubeadm-control-plane : # # Build kubeadm control plane manager
190
- go build -ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /kubeadm-control-plane-manager sigs.k8s.io/cluster-api/controlplane/kubeadm
190
+ go build -trimpath - ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /kubeadm-control-plane-manager sigs.k8s.io/cluster-api/controlplane/kubeadm
191
191
192
192
.PHONY : managers
193
193
managers : # # Build all managers
@@ -197,7 +197,7 @@ managers: ## Build all managers
197
197
198
198
.PHONY : clusterctl
199
199
clusterctl : # # Build clusterctl binary
200
- go build -ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /clusterctl sigs.k8s.io/cluster-api/cmd/clusterctl
200
+ go build -trimpath - ldflags " $( LDFLAGS) " -o $(BIN_DIR ) /clusterctl sigs.k8s.io/cluster-api/cmd/clusterctl
201
201
202
202
$(SETUP_ENVTEST ) : $(TOOLS_DIR ) /go.mod # Build setup-envtest from tools folder.
203
203
cd $(TOOLS_DIR ) ; go build -tags=tools -o $(BIN_DIR ) /setup-envtest sigs.k8s.io/controller-runtime/tools/setup-envtest
@@ -587,10 +587,11 @@ release-manifests-dev: ## Builds the development manifests and copies them in th
587
587
cp $(CAPD_DIR ) /templates/* $(RELEASE_DIR ) /
588
588
589
589
release-binaries : # # Builds the binaries to publish with a release
590
- RELEASE_BINARY=./cmd/clusterctl GOOS=linux GOARCH=amd64 $(MAKE ) release-binary
591
- RELEASE_BINARY=./cmd/clusterctl GOOS=linux GOARCH=arm64 $(MAKE ) release-binary
592
- RELEASE_BINARY=./cmd/clusterctl GOOS=darwin GOARCH=amd64 $(MAKE ) release-binary
593
- RELEASE_BINARY=./cmd/clusterctl GOOS=darwin GOARCH=arm64 $(MAKE ) release-binary
590
+ RELEASE_BINARY=clusterctl-linux-amd64 BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=amd64 $(MAKE ) release-binary
591
+ RELEASE_BINARY=clusterctl-linux-arm64 BUILD_PATH=./cmd/clusterctl GOOS=linux GOARCH=arm64 $(MAKE ) release-binary
592
+ RELEASE_BINARY=clusterctl-darwin-amd64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=amd64 $(MAKE ) release-binary
593
+ RELEASE_BINARY=clusterctl-darwin-arm64 BUILD_PATH=./cmd/clusterctl GOOS=darwin GOARCH=arm64 $(MAKE ) release-binary
594
+ RELEASE_BINARY=clusterctl-windows-amd64.exe BUILD_PATH=./cmd/clusterctl GOOS=windows GOARCH=amd64 $(MAKE ) release-binary
594
595
595
596
release-binary : $(RELEASE_DIR )
596
597
docker run \
@@ -601,8 +602,8 @@ release-binary: $(RELEASE_DIR)
601
602
-v " $$ (pwd):/workspace$( DOCKER_VOL_OPTS) " \
602
603
-w /workspace \
603
604
golang:$(GO_VERSION ) \
604
- go build -a -ldflags " $( LDFLAGS) -extldflags '-static'" \
605
- -o $(RELEASE_DIR ) /$(notdir $(RELEASE_BINARY ) ) - $( GOOS ) - $( GOARCH ) $(RELEASE_BINARY )
605
+ go build -a -trimpath - ldflags " $( LDFLAGS) -extldflags '-static'" \
606
+ -o $(RELEASE_DIR ) /$(notdir $(RELEASE_BINARY ) ) $(BUILD_PATH )
606
607
607
608
.PHONY : release-staging
608
609
release-staging : # # Builds and push container images to the staging bucket.
0 commit comments