Browse Source

Revert arch.mk refactor.

tags/v2.2.0
Andrew Belt 2 years ago
parent
commit
765c213ec5
1 changed files with 14 additions and 14 deletions
  1. +14
    -14
      arch.mk

+ 14
- 14
arch.mk View File

@@ -1,34 +1,34 @@
MACHINE := $(shell $(CC) -dumpmachine) MACHINE := $(shell $(CC) -dumpmachine)
MACHINE_LIST := $(subst -, ,$(MACHINE))
MACHINE_ARCH := $(word 1, $(MACHINE_LIST))
MACHINE_VENDOR := $(word 2, $(MACHINE_LIST))
MACHINE_OS := $(word 3, $(MACHINE_LIST))


ifeq ($(MACHINE_ARCH),x86_64)
ifneq (,$(findstring x86_64-,$(MACHINE)))
ARCH_X64 := 1 ARCH_X64 := 1
ARCH_NAME := x64 ARCH_NAME := x64
else ifeq ($(MACHINE_ARCH),arm64)
else ifneq (,$(findstring arm64-,$(MACHINE)))
ARCH_ARM64 := 1 ARCH_ARM64 := 1
ARCH_NAME := arm64 ARCH_NAME := arm64
else else
$(error CPU architecture $(MACHINE_ARCH) not supported)
$(error Could not determine CPU architecture of $(MACHINE))
endif endif


ifneq (,$(findstring darwin,$(MACHINE_OS)))
ifneq (,$(findstring -darwin,$(MACHINE)))
ARCH_MAC := 1 ARCH_MAC := 1
ARCH_OS_NAME := mac ARCH_OS_NAME := mac
else ifneq (,$(findstring mingw32,$(MACHINE_OS)))
else ifneq (,$(findstring -mingw32,$(MACHINE)))
ARCH_WIN := 1 ARCH_WIN := 1
ARCH_OS_NAME := win ARCH_OS_NAME := win
else ifneq (,$(findstring linux,$(MACHINE_OS)))
else ifneq (,$(findstring -linux,$(MACHINE)))
ARCH_LIN := 1 ARCH_LIN := 1
ARCH_OS_NAME := lin ARCH_OS_NAME := lin
else else
$(error Operating system $(MACHINE_OS) not supported)
$(error Could not determine operating system of $(MACHINE))
endif endif




ARCH_FULL_NAME := $(ARCH_OS_NAME)
ifndef ARCH_X64
ARCH_FULL_NAME := $(ARCH_FULL_NAME)_$(ARCH_NAME)
# The architecture "full name" is used in package filenames.
# Examples: win, lin, mac, mac_arm64
ifdef ARCH_X64
# Omit arch name for x64
ARCH_FULL_NAME := $(ARCH_OS_NAME)
else
ARCH_FULL_NAME := $(ARCH_OS_NAME)_$(ARCH_NAME)
endif endif

Loading…
Cancel
Save