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.

27 lines
605B

  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
  9. $(error Could not determine CPU architecture of $(MACHINE))
  10. endif
  11. ifneq (,$(findstring -darwin,$(MACHINE)))
  12. ARCH_MAC := 1
  13. ARCH_OS := mac
  14. else ifneq (,$(findstring -mingw32,$(MACHINE)))
  15. ARCH_WIN := 1
  16. ARCH_OS := win
  17. else ifneq (,$(findstring -linux,$(MACHINE)))
  18. ARCH_LIN := 1
  19. ARCH_OS := lin
  20. else
  21. $(error Could not determine operating system of $(MACHINE))
  22. endif
  23. ARCH_NAME := $(ARCH_OS)_$(ARCH_CPU)