From abff42a0ea747cafcf13954772b459e5a02aa88b Mon Sep 17 00:00:00 2001 From: anothersimulacrum Date: Sat, 25 Apr 2020 21:24:20 -0700 Subject: [PATCH] Allow specifying clang version in makefile This reverts the CLANG specific checks added in 9eb2ff504ac25dc9d7f95ebc59660fd1ec289174, because they would break if a specific CLANG version was specified instead of a generic one. I hope to be able to make it so that you don't use CLANG even if your make command has CLANG=0, but as these changes are they break things, so I'll revert them and work on that later. --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 422f4bc97c932..b565b3c927954 100644 --- a/Makefile +++ b/Makefile @@ -226,7 +226,7 @@ ifneq ($(findstring BSD,$(OS)),) endif # This sets CXX and so must be up here -ifeq ($(CLANG), 1) +ifdef CLANG # Allow setting specific CLANG version ifeq ($(CLANG), 1) CLANGCMD = clang++ @@ -240,7 +240,7 @@ ifeq ($(CLANG), 1) OTHERS += -stdlib=libc++ LDFLAGS += -stdlib=libc++ endif - ifdef CCACHE + ifeq ($(CCACHE), 1) CXX = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD) LD = CCACHE_CPP2=1 ccache $(CROSS)$(CLANGCMD) else @@ -306,7 +306,7 @@ ifeq ($(RELEASE), 1) endif ifeq ($(LTO), 1) - ifeq ($(CLANG), 1) + ifdef CLANG # LLVM's LTO will complain if the optimization level isn't between O0 and # O3 (inclusive) OPTLEVEL = -O3 @@ -316,14 +316,14 @@ ifeq ($(RELEASE), 1) ifeq ($(LTO), 1) ifeq ($(NATIVE), osx) - ifeq ($(CLANG), 1) + ifdef CLANG LTOFLAGS += -flto=full endif else LDFLAGS += -fuse-ld=gold # This breaks in OS X because gold can only produce ELF binaries, not Mach endif - ifeq ($(CLANG), 1) + ifdef CLANG LTOFLAGS += -flto else LTOFLAGS += -flto=jobserver -flto-odr-type-merging @@ -423,7 +423,7 @@ endif # OSX ifeq ($(NATIVE), osx) - ifeq ($(CLANG), 1) + ifdef CLANG OSX_MIN = 10.7 else OSX_MIN = 10.5