aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorPlatin21 <arminmops@icloud.com>2022-01-22 17:34:43 +0100
committerPlatin21 <arminmops@icloud.com>2022-01-22 17:34:43 +0100
commit0e0638362015665411d1454a1a7292de9fe97fed (patch)
tree3f3860ad6e6ccec7597e1856dc55608b7dfbdbca /Makefile
parentcfbc1a447bba4e3648d9e15c1f776d6d8068951e (diff)
Changed make file so that it allows for multiple LLVM versions instead of a single one on Darwin
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 15 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index a7aecbb2d..6acecccc4 100644
--- a/Makefile
+++ b/Makefile
@@ -11,19 +11,23 @@ ifeq ($(OS), Darwin)
ARCH=$(shell uname -m)
LLVM_CONFIG=llvm-config
- # LLVM Version Setting
- LLVM_VERSION_PATTERN="^11\."
- LLVM_VERSION="11"
ifeq ($(ARCH), arm64)
- LLVM_VERSION="13"
- LLVM_VERSION_PATTERN="^13"
- endif
-
- ifneq ($(shell llvm-config --version | grep $(LLVM_VERSION_PATTERN)),)
- LLVM_CONFIG=llvm-config
+ ifneq ($(shell llvm-config --version | grep "^13\."),)
+ LLVM_CONFIG=llvm-config
+ else
+ $(error "Requirement: llvm-config must be version llvm 13 for arm64")
+ endif
else
- $(error "Requirement: llvm-config must be version $(LLVM_VERSION)")
- endif
+ ifneq ($(shell llvm-config --version | grep "^11\."),)
+ LLVM_CONFIG=llvm-config
+ else ifneq ($(shell llvm-config --version | grep "^12\."),)
+ LLVM_CONFIG=llvm-config
+ else ifneq ($(shell llvm-config --version | grep "^13\."),)
+ LLVM_CONFIG=llvm-config
+ else
+ $(error "Requirement: llvm-config must be version llvm 11 or 12 or 13 for amd64/x86")
+ endif
+ endif
LDFLAGS:=$(LDFLAGS) -liconv
CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)