Makefile 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. NO_PERF_REGS := 1
  8. # Additional ARCH settings for x86
  9. ifeq ($(ARCH),i386)
  10. override ARCH := x86
  11. NO_PERF_REGS := 0
  12. LIBUNWIND_LIBS = -lunwind -lunwind-x86
  13. endif
  14. ifeq ($(ARCH),x86_64)
  15. override ARCH := x86
  16. IS_X86_64 := 0
  17. ifeq (, $(findstring m32,$(EXTRA_CFLAGS)))
  18. IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1)
  19. endif
  20. ifeq (${IS_X86_64}, 1)
  21. RAW_ARCH := x86_64
  22. ARCH_CFLAGS := -DARCH_X86_64
  23. ARCH_INCLUDE = ../../arch/x86/lib/memcpy_64.S ../../arch/x86/lib/memset_64.S
  24. endif
  25. NO_PERF_REGS := 0
  26. LIBUNWIND_LIBS = -lunwind -lunwind-x86_64
  27. endif
  28. ifeq ($(NO_PERF_REGS),0)
  29. BASIC_CFLAGS += -DHAVE_PERF_REGS
  30. endif
  31. -include config/feature-tests.mak
  32. ifeq ($(call get-executable,$(FLEX)),)
  33. dummy := $(error Error: $(FLEX) is missing on this system, please install it)
  34. endif
  35. ifeq ($(call get-executable,$(BISON)),)
  36. dummy := $(error Error: $(BISON) is missing on this system, please install it)
  37. endif