You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
689B

  1. MACHINE := $(shell $(CC) -dumpmachine)
  2. ifneq (,$(findstring x86_64-,$(MACHINE)))
  3. ARCH_X64 := 1
  4. ARCH_CPU := x64
  5. else ifneq (,$(findstring arm64-,$(MACHINE)))
  6. ARCH_ARM64 := 1
  7. ARCH_CPU := arm64
  8. else ifneq (,$(findstring aarch64-,$(MACHINE)))
  9. ARCH_ARM64 := 1
  10. ARCH_CPU := arm64
  11. else
  12. $(error Could not determine CPU architecture of $(MACHINE))
  13. endif
  14. ifneq (,$(findstring -darwin,$(MACHINE)))
  15. ARCH_MAC := 1
  16. ARCH_OS := mac
  17. else ifneq (,$(findstring -mingw32,$(MACHINE)))
  18. ARCH_WIN := 1
  19. ARCH_OS := win
  20. else ifneq (,$(findstring -linux,$(MACHINE)))
  21. ARCH_LIN := 1
  22. ARCH_OS := lin
  23. else
  24. $(error Could not determine operating system of $(MACHINE))
  25. endif
  26. ARCH_NAME := $(ARCH_OS)-$(ARCH_CPU)