diff --git a/Makefile b/Makefile index 461ee56bd5e5..b573a7abc3af 100644 --- a/Makefile +++ b/Makefile @@ -59,7 +59,7 @@ EXPORTS_BUILD := \ CRYSTAL_CONFIG_LIBRARY_PATH=$(CRYSTAL_CONFIG_LIBRARY_PATH) SHELL = sh LLVM_CONFIG := $(shell src/llvm/ext/find-llvm-config) -LLVM_VERSION := $(if $(LLVM_CONFIG), $(shell $(LLVM_CONFIG) --version 2> /dev/null)) +LLVM_VERSION := $(if $(LLVM_CONFIG),$(shell $(LLVM_CONFIG) --version 2> /dev/null)) LLVM_EXT_DIR = src/llvm/ext LLVM_EXT_OBJ = $(LLVM_EXT_DIR)/llvm_ext.o DEPS = $(LLVM_EXT_OBJ) @@ -80,6 +80,12 @@ else colorize = $(shell printf >&2 "\033[33m$1\033[0m\n") endif +ifneq ($(LLVM_VERSION),) + ifeq ($(shell test $(firstword $(subst ., ,$(LLVM_VERSION))) -ge 18; echo $$?),0) + DEPS = + endif +endif + check_llvm_config = $(eval \ check_llvm_config := $(if $(LLVM_VERSION),\ $(call colorize,Using $(LLVM_CONFIG) [version=$(LLVM_VERSION)]),\ @@ -208,7 +214,7 @@ $(O)/primitives_spec: $(O)/crystal $(DEPS) $(SOURCES) $(SPEC_SOURCES) @mkdir -p $(O) $(EXPORT_CC) ./bin/crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o $@ spec/primitives_spec.cr -$(O)/interpreter_spec: deps $(SOURCES) $(SPEC_SOURCES) +$(O)/interpreter_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES) $(eval interpreter=1) @mkdir -p $(O) $(EXPORT_CC) ./bin/crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o $@ spec/compiler/interpreter_spec.cr diff --git a/Makefile.win b/Makefile.win index 2e4899e58f8d..dd7189ca24ef 100644 --- a/Makefile.win +++ b/Makefile.win @@ -82,6 +82,12 @@ DATADIR ?= $(prefix) colorize = $1 +ifneq ($(LLVM_VERSION),) + ifeq ($(shell if $(firstword $(subst ., ,$(LLVM_VERSION))) GEQ 18 echo 0),0) + DEPS = + endif +endif + check_llvm_config = $(eval \ check_llvm_config := $(if $(LLVM_VERSION),\ $(info $(call colorize,Using $(LLVM_CONFIG) [version=$(LLVM_VERSION)])),\ @@ -198,7 +204,7 @@ $(O)\primitives_spec.exe: $(O)\crystal.exe $(DEPS) $(SOURCES) $(SPEC_SOURCES) @$(call MKDIR,"$(O)") .\bin\crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o "$@" spec\primitives_spec.cr -$(O)\interpreter_spec: deps $(SOURCES) $(SPEC_SOURCES) +$(O)\interpreter_spec: $(DEPS) $(SOURCES) $(SPEC_SOURCES) $(eval interpreter=1) @$(call MKDIR, "$(O)") .\bin\crystal build $(FLAGS) $(SPEC_WARNINGS_OFF) -o $@ spec\compiler\interpreter_spec.cr