Makefile.arch 721 B

12345678910111213141516171819202122
  1. uname_M := $(shell uname -m 2>/dev/null || echo not)
  2. ARCH ?= $(shell echo $(uname_M) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
  3. -e s/arm.*/arm/ -e s/sa110/arm/ \
  4. -e s/s390x/s390/ -e s/parisc64/parisc/ \
  5. -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
  6. -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
  7. # Additional ARCH settings for x86
  8. ifeq ($(ARCH),i386)
  9. override ARCH := x86
  10. endif
  11. ifeq ($(ARCH),x86_64)
  12. override ARCH := x86
  13. IS_X86_64 := 0
  14. ifeq (, $(findstring m32,$(CFLAGS)))
  15. IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
  16. RAW_ARCH := x86_64
  17. endif
  18. endif