aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-16 07:12:44 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-06-16 23:10:15 +0200
commitcbd3735049526d55d79b7176019f4a0c02a41dca (patch)
treebd67ee20be879b91048742333de8e21741e926d0
parentbf1408ac0d6131ea4a61785d2de27bfd091e26c8 (diff)
downloadsparse-cbd3735049526d55d79b7176019f4a0c02a41dca.tar.gz
build: let the C++ compiler be configurable
By default, the C compiler is 'gcc' but it can be overridden on the command line via 'make CC=...'. However, the C++ compiler (only needed for sparse-llvm) is hardcoded to 'g++'. Fix this by allowing to specify the C++ compiler via 'CXX=...' but keeping 'g++' as the default. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--Makefile3
1 files changed, 2 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f46654e7..07de0bc3 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ OS = linux
CC = gcc
+CXX = g++
LD = $(CC)
AR = ar
@@ -189,7 +190,7 @@ LLVM_VERSION:=$(shell $(LLVM_CONFIG) --version)
LLVM_VERSION_MAJOR:=$(firstword $(subst ., ,$(LLVM_VERSION)))
ifeq ($(shell expr "$(LLVM_VERSION_MAJOR)" '>=' 3),1)
LLVM_PROGS := sparse-llvm
-$(LLVM_PROGS): LD := g++
+$(LLVM_PROGS): LD := $(CXX)
LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
LLVM_CFLAGS := $(shell $(LLVM_CONFIG) --cppflags)
LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)