blob: 4b06719ee984618c6154fa0bfbadd78977a4861e [file] [log] [blame]
Jiri Olsaa6cf5f32014-01-03 15:32:32 +01001
2uname_M := $(shell uname -m 2>/dev/null || echo not)
3
4ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
5 -e s/arm.*/arm/ -e s/sa110/arm/ \
6 -e s/s390x/s390/ -e s/parisc64/parisc/ \
7 -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
Zhigang Lu620830b2014-02-11 11:03:48 +08008 -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ \
9 -e s/tile.*/tile/ )
Jiri Olsaa6cf5f32014-01-03 15:32:32 +010010
11# Additional ARCH settings for x86
12ifeq ($(ARCH),i386)
13 override ARCH := x86
14endif
15
16ifeq ($(ARCH),x86_64)
17 override ARCH := x86
18 IS_X86_64 := 0
19 ifeq (, $(findstring m32,$(CFLAGS)))
20 IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
21 RAW_ARCH := x86_64
22 endif
23endif