Commit 6917d2f0 authored by Steven Allen's avatar Steven Allen

build for all supported platforms when testing

fixes #4427

License: MIT
Signed-off-by: default avatarSteven Allen <steven@stebalien.com>
parent 66bde413
......@@ -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
......
......@@ -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:=,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment