162306a36Sopenharmony_ci# SUBARCH tells the usermode build what the underlying arch is.  That is set
262306a36Sopenharmony_ci# first, and if a usermode build is happening, the "ARCH=um" on the command
362306a36Sopenharmony_ci# line overrides the setting of ARCH below.  If a native build is happening,
462306a36Sopenharmony_ci# then ARCH is assigned, getting whatever value it gets normally, and
562306a36Sopenharmony_ci# SUBARCH is subsequently ignored.
662306a36Sopenharmony_ci
762306a36Sopenharmony_ciSUBARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
862306a36Sopenharmony_ci				  -e s/sun4u/sparc64/ \
962306a36Sopenharmony_ci				  -e s/arm.*/arm/ -e s/sa110/arm/ \
1062306a36Sopenharmony_ci				  -e s/s390x/s390/ \
1162306a36Sopenharmony_ci				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
1262306a36Sopenharmony_ci				  -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
1362306a36Sopenharmony_ci				  -e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
14