aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-05-11 12:31:56 +0100
committergingerBill <bill@gingerbill.org>2021-05-11 12:31:56 +0100
commitd0f7cf74e94741f2820a61ecba60ed5be460a921 (patch)
tree865b140dda7e98563faf593a01c31eb1afb093f5 /Makefile
parente1c2528d87b182b19311ffad71a060acf218a7a4 (diff)
Add llvm-config version 11 check for Darwin in Makefile
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 23 insertions, 18 deletions
diff --git a/Makefile b/Makefile
index 6633438bc..5cdf1e467 100644
--- a/Makefile
+++ b/Makefile
@@ -8,26 +8,31 @@ CC=clang
OS=$(shell uname)
ifeq ($(OS), Darwin)
- LLVM_CONFIG=llvm-config
-
- LDFLAGS:=$(LDFLAGS) -liconv
- CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
- LDFLAGS:=$(LDFLAGS) -lLLVM-C
+ LLVM_CONFIG=llvm-config
+ ifneq ($(shell llvm-config --version | grep '^11\.'),)
+ LLVM_CONFIG=llvm-config
+ else
+ $(error "Requirement: llvm-config must be version 11")
+ endif
+
+ LDFLAGS:=$(LDFLAGS) -liconv
+ CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
+ LDFLAGS:=$(LDFLAGS) -lLLVM-C
endif
ifeq ($(OS), Linux)
- LLVM_CONFIG=llvm-config-11
- ifneq ($(shell which llvm-config-11 2>/dev/null),)
- LLVM_CONFIG=llvm-config-11
- else
- ifneq ($(shell llvm-config --version | grep '^11\.'),)
- LLVM_CONFIG=llvm-config
- else
- $(error "Requirement: llvm-config must be version 11")
- endif
- endif
-
- CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
- LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs)
+ LLVM_CONFIG=llvm-config-11
+ ifneq ($(shell which llvm-config-11 2>/dev/null),)
+ LLVM_CONFIG=llvm-config-11
+ else
+ ifneq ($(shell llvm-config --version | grep '^11\.'),)
+ LLVM_CONFIG=llvm-config
+ else
+ $(error "Requirement: llvm-config must be version 11")
+ endif
+ endif
+
+ CFLAGS:=$(CFLAGS) $(shell $(LLVM_CONFIG) --cxxflags --ldflags)
+ LDFLAGS:=$(LDFLAGS) $(shell $(LLVM_CONFIG) --libs core native --system-libs)
endif
all: debug demo