Makefile.arch 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # SPDX-License-Identifier: GPL-2.0
  2. HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
  3. -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
  4. -e /arm64/!s/arm.*/arm/ -e s/sa110/arm/ \
  5. -e s/s390x/s390/ -e s/parisc64/parisc/ \
  6. -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
  7. -e s/sh[234].*/sh/ -e s/aarch64.*/arm64/ )
  8. ifndef ARCH
  9. ARCH := $(HOSTARCH)
  10. endif
  11. SRCARCH := $(ARCH)
  12. # Additional ARCH settings for x86
  13. ifeq ($(ARCH),i386)
  14. SRCARCH := x86
  15. endif
  16. ifeq ($(ARCH),x86_64)
  17. SRCARCH := x86
  18. endif
  19. # Additional ARCH settings for sparc
  20. ifeq ($(ARCH),sparc32)
  21. SRCARCH := sparc
  22. endif
  23. ifeq ($(ARCH),sparc64)
  24. SRCARCH := sparc
  25. endif
  26. # Additional ARCH settings for sh
  27. ifeq ($(ARCH),sh64)
  28. SRCARCH := sh
  29. endif
  30. LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
  31. ifeq ($(LP64), 1)
  32. IS_64_BIT := 1
  33. else
  34. IS_64_BIT := 0
  35. endif