Skip to content

Commit

Permalink
allow DEVMEMD=1 build on non-Arm
Browse files Browse the repository at this point in the history
  • Loading branch information
algrant-arm committed Mar 25, 2024
1 parent 6761f1c commit a57d0b5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions makefile-arch.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,25 @@
#
# Architecture and cross compile tests for makefiles
#
# There are three architectures involved:
#
# PLAT_ARCH - the architecture we are on now: the build platform;
# when cross-compiling, this could be anything
#
# ARCH - the architecture of the CSAL binaries:
# this will be arm or arm64, except in the case that
# DEVMEMD=1 when it could be anything
#
# target arch - this will be an Arm architecture of some kind,
# and will be the same as ARCH except when DEVMEMD=1
#

# figure platform arch
ifndef PLAT_ARCH
PLAT_ARCH := $(shell uname -m 2>/dev/null || echo not)
endif

ifneq ($(DEVMEMD),1)
ifeq ($(PLAT_ARCH),$(filter $(PLAT_ARCH), x86 x86_64 ))
ifeq ($(CROSS_COMPILE), )
$(error no CROSS_COMPILE set on x86 platform)
Expand All @@ -33,12 +46,17 @@ ifeq ($(ARCH), )
$(error no arm target ARCH set on x86 platform)
endif
endif
endif

# set build arch - default to arm
ifndef ARCH
ifneq ($(DEVMEMD),1)
ifeq ($(PLAT_ARCH),$(filter $(PLAT_ARCH), aarch64 arm64 ))
ARCH=arm64
else
ARCH=arm
endif
else
ARCH=$(PLAT_ARCH)
endif
endif

0 comments on commit a57d0b5

Please sign in to comment.