Skip to content

Commit

Permalink
statically link CLI binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
sjenning committed Oct 9, 2024
1 parent 7569e06 commit 253973c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ PROMTOOL=$(abspath $(TOOLS_BIN_DIR)/promtool)
GO_GCFLAGS ?= -gcflags=all='-N -l'
GO=GO111MODULE=on GOWORK=off GOFLAGS=-mod=vendor go
GO_BUILD_RECIPE=CGO_ENABLED=1 $(GO) build $(GO_GCFLAGS)
GO_CLI_RECIPE=CGO_ENABLED=0 $(GO) build $(GO_GCFLAGS) -ldflags '-extldflags "-static"'
GO_E2E_RECIPE=CGO_ENABLED=1 $(GO) test $(GO_GCFLAGS) -tags e2e -c

OUT_DIR ?= bin
Expand Down Expand Up @@ -87,11 +88,11 @@ control-plane-pki-operator:

.PHONY: hypershift
hypershift:
$(GO_BUILD_RECIPE) -o $(OUT_DIR)/hypershift .
$(GO_CLI_RECIPE) -o $(OUT_DIR)/hypershift .

.PHONY: product-cli
product-cli:
$(GO_BUILD_RECIPE) -o $(OUT_DIR)/hcp ./product-cli
$(GO_CLI_RECIPE) -o $(OUT_DIR)/hcp ./product-cli

# Run this when updating any of the types in the api package to regenerate the
# deepcopy code and CRD manifest files.
Expand Down

0 comments on commit 253973c

Please sign in to comment.