2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2016-07-22 09:55:53 -03:00
|
|
|
HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
|
2015-03-02 13:31:03 +09:00
|
|
|
-e s/sun4u/sparc/ -e s/sparc64/sparc/ \
|
2015-03-17 13:29:47 +00:00
|
|
|
-e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
|
2014-01-03 15:32:32 +01:00
|
|
|
-e s/s390x/s390/ -e s/parisc64/parisc/ \
|
|
|
|
|
-e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
|
2021-10-28 18:10:55 +02:00
|
|
|
-e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
|
2023-02-25 15:52:57 +08:00
|
|
|
-e s/riscv.*/riscv/ -e s/loongarch.*/loongarch/)
|
2016-07-22 14:19:20 -05:00
|
|
|
|
2024-11-27 11:17:46 +01:00
|
|
|
ifeq ($(strip $(ARCH)),)
|
|
|
|
|
override ARCH := $(HOSTARCH)
|
2016-07-22 09:55:53 -03:00
|
|
|
endif
|
2014-01-03 15:32:32 +01:00
|
|
|
|
2016-07-22 14:19:20 -05:00
|
|
|
SRCARCH := $(ARCH)
|
|
|
|
|
|
|
|
|
|
# Additional ARCH settings for x86
|
|
|
|
|
ifeq ($(ARCH),i386)
|
|
|
|
|
SRCARCH := x86
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(ARCH),x86_64)
|
|
|
|
|
SRCARCH := x86
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
# Additional ARCH settings for sparc
|
|
|
|
|
ifeq ($(ARCH),sparc32)
|
|
|
|
|
SRCARCH := sparc
|
|
|
|
|
endif
|
|
|
|
|
ifeq ($(ARCH),sparc64)
|
|
|
|
|
SRCARCH := sparc
|
|
|
|
|
endif
|
|
|
|
|
|
2023-02-25 15:52:57 +08:00
|
|
|
# Additional ARCH settings for loongarch
|
|
|
|
|
ifeq ($(ARCH),loongarch32)
|
|
|
|
|
SRCARCH := loongarch
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(ARCH),loongarch64)
|
|
|
|
|
SRCARCH := loongarch
|
|
|
|
|
endif
|
|
|
|
|
|
2015-01-12 10:20:55 +08:00
|
|
|
LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
|
|
|
|
|
ifeq ($(LP64), 1)
|
2014-10-23 18:16:03 -03:00
|
|
|
IS_64_BIT := 1
|
|
|
|
|
else
|
2015-01-12 10:20:55 +08:00
|
|
|
IS_64_BIT := 0
|
2014-10-23 18:16:03 -03:00
|
|
|
endif
|