# set makefile variables according to the installed Clang version # check whether llvm-config is available ifeq ($(shell which $(LLVMCONF)),) $(error FRONTEND is 'Clang', but LLVMCONF ($(LLVMCONF)) is not found) endif LLVM_VERSION := $(shell $(LLVMCONF) --version) # Calculate a numeric representation of the LLVM version string LLVM_MAJOR := $(word 1, $(subst ., , $(LLVM_VERSION))) LLVM_MINOR := $(word 2, $(subst ., , $(LLVM_VERSION))) LLVM_PATCH := $(word 3, $(subst ., , $(LLVM_VERSION))) # check if the config file for this version exists ifeq ($(wildcard config/clang-$(LLVM_VERSION).mk),) $(error UNSUPPORTED Clang version '$(LLVM_VERSION)' used -- try 'make -C config clang LLVMCONF=$(LLVMCONF)') endif include config/clang-$(LLVM_VERSION).mk ifeq ($(PLATFORM),macos) # on macOS the symbols have an additional '_' LLVM_SYMBOLS := $(patsubst %, _%, $(LLVM_SYMBOLS)) LLVM_SYMBOLS_SEMA := $(LLVM_SYMBOLS) endif