Skip to content

Commit

Permalink
put all of -extldflags and its options in quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
alphanota committed Jan 8, 2025
1 parent c5fe2d8 commit 290d873
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ endif

# when build for local development (`LOCAL=true make install` can skip license check)
$(BUILD_DIR)/$(PROJECT): $(EMBEDDED_FILES_CHECK) $(GO_FILES) $(BUILD_DIR)
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,-extldflags "%",$(LDFLAGS_$(GOOS))))
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,'-extldflags %',$(LDFLAGS_$(GOOS))))
$(eval tags = $(GO_BUILD_TAGS) $(GO_BUILD_TAGS_$(GOOS)) $(GO_BUILD_TAGS_$(GOOS)_$(GOARCH)))
GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=1 \
go build -mod="vendor" -gcflags="all=-N -l" -tags "$(tags)" -ldflags '$(ldflags)' -o $@ $(BUILD_PACKAGE)
go build -mod="vendor" -gcflags="all=-N -l" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ $(BUILD_PACKAGE)
ifeq ($(GOOS),darwin)
codesign --force --deep --sign - $@
endif
Expand All @@ -96,9 +96,9 @@ cross: $(foreach platform, $(SUPPORTED_PLATFORMS), $(BUILD_DIR)/$(PROJECT)-$(pla
$(BUILD_DIR)/$(PROJECT)-%: $(EMBEDDED_FILES_CHECK) $(GO_FILES) $(BUILD_DIR)
$(eval os = $(firstword $(subst -, ,$*)))
$(eval arch = $(lastword $(subst -, ,$(subst .exe,,$*))))
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,-extldflags "%",$(LDFLAGS_$(os))))
$(eval ldflags = $(GO_LDFLAGS) $(patsubst %,'-extldflags %',$(LDFLAGS_$(os))))
$(eval tags = $(GO_BUILD_TAGS) $(GO_BUILD_TAGS_$(os)) $(GO_BUILD_TAGS_$(os)_$(arch)))
GOOS=$(os) GOARCH=$(arch) CGO_ENABLED=1 go build -mod="vendor" -tags "$(tags)" -ldflags '$(ldflags)' -o $@ ./cmd/skaffold
GOOS=$(os) GOARCH=$(arch) CGO_ENABLED=1 go build -mod="vendor" -tags "$(tags)" -ldflags "$(ldflags)" -o $@ ./cmd/skaffold
(cd `dirname $@`; shasum -a 256 `basename $@`) | tee $@.sha256
file $@ || true

Expand Down

0 comments on commit 290d873

Please sign in to comment.