Makefile.arch 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. HOSTARCH := $(shell uname -m | sed -e s/i.86/x86/ -e s/x86_64/x86/ \
  2. -e s/sun4u/sparc/ -e s/sparc64/sparc/ \
  3. -e /arm64/!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. -e s/tile.*/tile/ )
  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. # Additional ARCH settings for tile
  31. ifeq ($(ARCH),tilepro)
  32. SRCARCH := tile
  33. endif
  34. ifeq ($(ARCH),tilegx)
  35. SRCARCH := tile
  36. endif
  37. LP64 := $(shell echo __LP64__ | ${CC} ${CFLAGS} -E -x c - | tail -n 1)
  38. ifeq ($(LP64), 1)
  39. IS_64_BIT := 1
  40. else
  41. IS_64_BIT := 0
  42. endif