Skip to content

Commit

Permalink
fix(cdsctl): makefiles (#4818)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsamin authored and sguiheux committed Dec 11, 2019
1 parent bb1a771 commit b953fe9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ build:
$(MAKE) build -C ui
$(MAKE) build -C engine OS="${TARGET_OS}" ARCH="${TARGET_ARCH}"
$(MAKE) build -C engine/worker OS="${TARGET_OS}" ARCH="${TARGET_ARCH}"
$(MAKE) build -C cli/cdsctl OS="${TARGET_OS}" ARCH="${TARGET_ARCH}"
$(MAKE) build -C cli/cdsctl OS="$(foreach OS,${TARGET_OS},${OS}/%)" ARCH="$(foreach ARCH,${TARGET_ARCH},%/${ARCH})"
$(MAKE) build -C contrib OS="${TARGET_OS}" ARCH="${TARGET_ARCH}"
$(MAKE) package -C contrib TARGET_DIST="$(abspath $(TARGET_DIR))"

Expand Down
4 changes: 2 additions & 2 deletions cli/cdsctl/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ TARGET_BINARY = cdsctl
TARGET_LDFLAGS = -ldflags "-X github.com/ovh/cds/sdk.VERSION=$(VERSION) -X github.com/ovh/cds/sdk.GOOS=$$GOOS -X github.com/ovh/cds/sdk.GOARCH=$$GOARCH -X github.com/ovh/cds/sdk.GITHASH=$(GITHASH) -X github.com/ovh/cds/sdk.BUILDTIME=$(BUILDTIME) -X github.com/ovh/cds/sdk.BINARY=$(TARGET_BINARY)"

split = $(word $2,$(subst /, ,$1))
TARGET_OS := $(if ${OS},${OS}/%, linux/% darwin/% windows/% freebsd/% openbsd/%)
TARGET_ARCH := $(if ${ARCH}, %/${ARCH}, %/amd64 %/arm %/386 %/arm64)
TARGET_OS := $(if ${OS},${OS}, linux/% darwin/% windows/% freebsd/% openbsd/%)
TARGET_ARCH := $(if ${ARCH}, ${ARCH}, %/amd64 %/arm %/386 %/arm64)
TARGET_DISTS := $(filter $(TARGET_OS), $(filter $(TARGET_ARCH), $(shell go tool dist list)))
isWindows = $(filter $1,windows)
TARGET_BINARIES := $(foreach DIST, $(filter-out darwin/arm% darwin/386,$(TARGET_DISTS)), $(TARGET_DIR)/cdsctl-$(call split,$(DIST),1)-$(call split,$(DIST),2)$(if $(call isWindows, $(call split,$(DIST),1)),.exe))
Expand Down

0 comments on commit b953fe9

Please sign in to comment.