Skip to content

Commit 19addcc

Browse files
committed
WIP: crossbuilds will detect if we are trying to build from a arm64 host and echo a message to the user
1 parent 31ffadb commit 19addcc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

scripts/docker/crossbuild.mk

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ crossbuild crossbuild.help :
88
@echo crossbuild requires Docker to be installed
99
else
1010

11+
UNAME_M := $(shell uname -m)
12+
1113
#
1214
# Short list of common builds
1315
#
@@ -38,6 +40,17 @@ CB_PROF_CPREFIX:=fr40x-prof-
3840
# List of profiling images (only directories that contain a Dockerfile.cb)
3941
CB_PROF_IMAGES:=$(sort $(patsubst $(PT)/%/Dockerfile.cb,%,$(wildcard $(PT)/*/Dockerfile.cb)))
4042

43+
#
44+
# Building from arm64 is not supported. Check if a build target was requested.
45+
#
46+
ifneq (,$(filter $(UNAME_M),arm64 aarch64))
47+
_CB_BUILD_TARGETS := crossbuild crossbuild.common crossbuild.prof \
48+
$(foreach IMG,$(CB_IMAGES),crossbuild.$(IMG)) \
49+
$(foreach IMG,$(CB_PROF_IMAGES),crossbuild.$(IMG).prof)
50+
ifneq (,$(filter $(_CB_BUILD_TARGETS),$(MAKECMDGOALS)))
51+
$(error Building from arm64 is currently not supported)
52+
endif
53+
endif
4154

4255
# Location of the .git dir (may be different for e.g. submodules)
4356
GITDIR:=$(shell perl -MCwd -e 'print Cwd::abs_path shift' $$(git rev-parse --git-dir))

0 commit comments

Comments
 (0)