[PATCH] make: Allow to change a compiler if no CROSS_COMPILE prefix defined

Andrey Vagin avagin at openvz.org
Thu Jun 20 18:02:57 EDT 2013


For clang-analyzer we need to redefine CC variable, but then
it become imposibble to use CROSS_COMPILE prefix, thus make
a little trick to be able to use both.

Reported-by: Andrew Vagin <avagin at parallels.com>
CC: Chanho Park <chanho61.park at samsusng.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 Makefile | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 125b5b3..edbaf9b 100644
--- a/Makefile
+++ b/Makefile
@@ -26,8 +26,13 @@ include Makefile.config
 FIND		:= find
 CSCOPE		:= cscope
 RM		:= rm -f
-LD		:= $(CROSS_COMPILE)ld
+
+ifeq ($(CROSS_COMPILE),)
+CC		?= gcc
+else
 CC		:= $(CROSS_COMPILE)gcc
+endif
+LD		:= $(CROSS_COMPILE)ld
 NM		:= $(CROSS_COMPILE)nm
 SH		:= bash
 MAKE		:= make
-- 
1.8.1.4


--k+w/mQv8wyuph6w0--


More information about the CRIU mailing list