[Makefile] Force overwriting Makefile default values for CC and CXX
@@ -24,8 +24,14 @@ LLVM_INSTALL_DIR ?= ${INSTALL_DIR}/llvm
HALIDE_INSTALL_DIR ?= ${INSTALL_DIR}/halide
CMAKE ?= cmake-3.7.1
-CC ?= gcc-8.2.0
-CXX ?= g++-8.2.0
+# CC and CXX are Makefile default variables that are always defined in a Makefile. Hence, overwrite
+# the variable if it is only defined by the Makefile (its origin in the Makefile's default).
+ifeq ($(origin CC),default)
+CC = gcc-8.2.0
+endif
+ifeq ($(origin CXX),default)
+CXX = g++-8.2.0
+endif
# Default target
all: halide
