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.

35 lines
820B

  1. MACHINE := $(shell $(CC) -dumpmachine)
  2. ifneq (,$(findstring x86_64-,$(MACHINE)))
  3. ARCH_X64 := 1
  4. ARCH_NAME := x64
  5. else ifneq (,$(findstring arm64-,$(MACHINE)))
  6. ARCH_ARM64 := 1
  7. ARCH_NAME := arm64
  8. else
  9. $(error Could not determine CPU architecture of $(MACHINE))
  10. endif
  11. ifneq (,$(findstring -darwin,$(MACHINE)))
  12. ARCH_MAC := 1
  13. ARCH_OS_NAME := mac
  14. else ifneq (,$(findstring -mingw32,$(MACHINE)))
  15. ARCH_WIN := 1
  16. ARCH_OS_NAME := win
  17. else ifneq (,$(findstring -linux,$(MACHINE)))
  18. ARCH_LIN := 1
  19. ARCH_OS_NAME := lin
  20. else
  21. $(error Could not determine operating system of $(MACHINE))
  22. endif
  23. # The architecture "full name" is used in package filenames.
  24. # Examples: win, lin, mac, mac_arm64
  25. ifdef ARCH_X64
  26. # Omit arch name for x64
  27. ARCH_FULL_NAME := $(ARCH_OS_NAME)
  28. else
  29. ARCH_FULL_NAME := $(ARCH_OS_NAME)_$(ARCH_NAME)
  30. endif