summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordann frazier <dann.frazier@canonical.com>2019-12-09 13:54:13 -0700
committerJes Sorensen <jsorensen@fb.com>2020-01-16 13:46:53 -0500
commitaced6fc9542077a69b00d05bc9cd66c12fc34950 (patch)
tree3566b686444ab951ca531bd8e2e1fd57cfef67e1
parent027c099fd1a31fb3815e592de75d0791a22353b4 (diff)
downloadmdadm-aced6fc9542077a69b00d05bc9cd66c12fc34950.tar.gz
Respect $(CROSS_COMPILE) when $(CC) is the default
Commit 1180ed5 told make to only respect $(CROSS_COMPILE) when $(CC) was unset. But that will never be the case, as make provides a default value for $(CC). Change this logic to respect $(CROSS_COMPILE) when $(CC) is the default. Patch originally by Helmet Grohne. Fixes: 1180ed5 ("Makefile: make the CC definition conditional") Signed-off-by: dann frazier <dann.frazier@canonical.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
-rw-r--r--Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index dfe00b0a..a33319a8 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,9 @@ ifdef COVERITY
COVERITY_FLAGS=-include coverity-gcc-hack.h
endif
-CC ?= $(CROSS_COMPILE)gcc
+ifeq ($(origin CC),default)
+CC := $(CROSS_COMPILE)gcc
+endif
CXFLAGS ?= -ggdb
CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
ifdef WARN_UNUSED