mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-27 16:07:42 +08:00
Merge pull request #4445 from ipfs/fix/4427
build for all supported platforms when testing
This commit is contained in:
@ -2,6 +2,7 @@ include mk/header.mk
|
||||
IPFS_BIN_$(d) := $(call go-curr-pkg-tgt)
|
||||
|
||||
TGT_BIN += $(IPFS_BIN_$(d))
|
||||
TEST += $(d)-try-build
|
||||
CLEAN += $(IPFS_BIN_$(d))
|
||||
|
||||
PATH := $(realpath $(d)):$(PATH)
|
||||
@ -14,12 +15,22 @@ PATH := $(realpath $(d)):$(PATH)
|
||||
|
||||
$(d)_flags =-ldflags="-X "github.com/ipfs/go-ipfs/repo/config".CurrentCommit=$(shell git rev-parse --short HEAD)"
|
||||
|
||||
$(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
|
||||
$(d)-try-build $(IPFS_BIN_$(d)): GOFLAGS += $(cmd/ipfs_flags)
|
||||
|
||||
# uses second expansion to collect all $(DEPS_GO)
|
||||
$(IPFS_BIN_$(d)): $(d) $$(DEPS_GO) ALWAYS #| $(DEPS_OO_$(d))
|
||||
$(go-build)
|
||||
|
||||
TRY_BUILD_$(d)=$(addprefix $(d)-try-build-,$(SUPPORTED_PLATFORMS))
|
||||
$(d)-try-build: $(TRY_BUILD_$(d))
|
||||
.PHONY: $(d)-try-build
|
||||
|
||||
$(TRY_BUILD_$(d)): private PLATFORM = $(subst -, ,$(patsubst $<-try-build-%,%,$@))
|
||||
$(TRY_BUILD_$(d)): private GOOS = $(word 1,$(PLATFORM))
|
||||
$(TRY_BUILD_$(d)): private GOARCH = $(word 2,$(PLATFORM))
|
||||
$(TRY_BUILD_$(d)): $(d) $$(DEPS_GO) ALWAYS
|
||||
GOOS=$(GOOS) GOARCH=$(GOARCH) $(go-try-build)
|
||||
.PHONY: $(TRY_BUILD_$(d))
|
||||
|
||||
$(d)-install: GOFLAGS += $(cmd/ipfs_flags)
|
||||
$(d)-install: $(d) $$(DEPS_GO) ALWAYS
|
||||
|
@ -23,6 +23,10 @@ define go-build
|
||||
$(GOCC) build -i $(go-flags-with-tags) -o "$@" "$(call go-pkg-name,$<)"
|
||||
endef
|
||||
|
||||
define go-try-build
|
||||
$(GOCC) build $(go-flags-with-tags) -o /dev/null "$(call go-pkg-name,$<)"
|
||||
endef
|
||||
|
||||
test_go_short: GOTFLAGS += -test.short
|
||||
test_go_short: test_go_expensive
|
||||
.PHONY: test_go_short
|
||||
|
11
mk/util.mk
11
mk/util.mk
@ -9,6 +9,17 @@ else
|
||||
PATH_SEP :=:
|
||||
endif
|
||||
|
||||
# SUPPORTED_PLATFORM += windows/386 FIXME: #4438 (badger bug)
|
||||
SUPPORTED_PLATFORMS += windows-amd64
|
||||
|
||||
SUPPORTED_PLATFORMS += linux-arm
|
||||
SUPPORTED_PLATFORMS += linux-arm64
|
||||
SUPPORTED_PLATFORMS += linux-386
|
||||
SUPPORTED_PLATFORMS += linux-amd64
|
||||
|
||||
SUPPORTED_PLATFORMS += darwin-386
|
||||
SUPPORTED_PLATFORMS += darwin-amd64
|
||||
|
||||
space:=
|
||||
space+=
|
||||
comma:=,
|
||||
|
Reference in New Issue
Block a user