Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cdsctl): makefile #6894

Merged
merged 1 commit into from
Mar 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cli/cdsctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ $(TARGET_BINARIES):
@$(MAKE) --no-print-directory gobuild TAGS='' GOOS=$(call get_os_from_binary_file,$@) GOARCH=$(call get_arch_from_binary_file,$@) OUTPUT=$@

$(TARGET_BINARIES_VARIANT):
$(eval OS := $(call get_os_from_binary_file,$(subst -nokeychain,,$@)))
$(eval ARCH := $(call get_arch_from_binary_file,$(subst -nokeychain,,$@)))
$(eval BINARY_OS := $(call get_os_from_binary_file,$(subst -nokeychain,,$@)))
$(eval BINARY_ARCH := $(call get_arch_from_binary_file,$(subst -nokeychain,,$@)))
$(eval IS_LINUX := $(filter linux,$(OS)))
$(eval IS_DARWIN := $(filter darwin,$(OS)))
$(eval IS_WINDOWS := $(filter windows,$(OS)))
$(eval CGO_ENABLED := $(if $(IS_LINUX),0,1))
$(info *** building binary variant $@ GOOS=$(OS) GOARCH=$(ARCH))
@$(MAKE) --no-print-directory gobuild TAGS="--tags='nokeychain'" CGO_ENABLED=$(CGO_ENABLED) GOOS=$(OS) GOARCH=$(ARCH) OUTPUT=$@
$(info *** building binary variant $@ GOOS="$(BINARY_OS)" GOARCH="$(BINARY_ARCH)")
@$(MAKE) --no-print-directory gobuild TAGS="--tags='nokeychain'" CGO_ENABLED=$(CGO_ENABLED) GOOS="$(BINARY_OS)" GOARCH="$(BINARY_ARCH)" OUTPUT=$@

gobuild:
$(info ... $(OUTPUT))
@GOOS=$(GOOS) GOARCH=$(GOARCH) CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD) $(TAGS) $(TARGET_LDFLAGS) -o $(OUTPUT)
@GOOS="$(GOOS)" GOARCH="$(GOARCH)" CGO_ENABLED=$(CGO_ENABLED) $(GO_BUILD) $(TAGS) $(TARGET_LDFLAGS) -o $(OUTPUT)

build: $(TARGET_DIR) $(TARGET_BINARIES_VARIANT) $(TARGET_BINARIES)

Expand Down