Makefile.arch 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. -e s/tile.*/tile/ )
  9. ifndef ARCH
  10. ARCH := $(HOSTARCH)
  11. endif
  12. SRCARCH := $(ARCH)
  13. # Additional ARCH settings for x86
  14. ifeq ($(ARCH),i386)
  15. SRCARCH := x86
  16. endif
  17. ifeq ($(ARCH),x86_64)
  18. SRCARCH := x86
  19. endif
  20. # Additional ARCH settings for sparc
  21. ifeq ($(ARCH),sparc32)
  22. SRCARCH := sparc
  23. endif
  24. ifeq ($(ARCH),sparc64)
  25. SRCARCH := sparc
  26. endif
  27. # Additional ARCH settings for sh
  28. ifeq ($(ARCH),sh64)
  29. SRCARCH := sh
  30. endif
  31. # Additional ARCH settings for tile
  32. ifeq ($(ARCH),tilepro)
  33. SRCARCH := tile
  34. endif
  35. ifeq ($(ARCH),tilegx)
  36. SRCARCH := tile
  37. endif
  38. LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
  39. ifeq ($(LP64), 1)
  40. IS_64_BIT := 1
  41. else
  42. IS_64_BIT := 0
  43. endif