Skip to contentSkip to conversation

Makefile: make the CC definition conditional

PATCH Applied Maxin B. John 2 participants 2 messages Feb 8, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Makefile: make the CC definition conditional

From: "Maxin B. John" <[email protected]>

By hardcoding CC's definition in the Makefile, all the external gcc parameters set by tune settings are lost. This causes compile failure with x32 toolchain

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
index fd79cfb..5fd7f16 100644
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
 KLIBC_GCC = gcc -nostdinc -iwithprefix include -I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include -I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
 CXFLAGS ?= -ggdb
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED
Signature · 1 line
2.1.4
Applied
#1 lore raw
Quoted 10 lines · Maxin B. John

From: "Maxin B. John" <[email protected]>

By hardcoding CC's definition in the Makefile, all the external gcc parameters set by tune settings are lost. This causes compile failure with x32 toolchain

---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied!

Thanks,
Jes

Quoted 15 lines
Makefile +1 -3
index fd79cfb..5fd7f16 100644
@@ -41,7 +41,7 @@ KLIBC=/home/src/klibc/klibc-0.77
 
 KLIBC_GCC = gcc -nostdinc -iwithprefix include
-I$(KLIBC)/klibc/include -I$(KLIBC)/linux/include
-I$(KLIBC)/klibc/arch/i386/include -I$(KLIBC)/klibc/include/bits32
 
-CC = $(CROSS_COMPILE)gcc
+CC ?= $(CROSS_COMPILE)gcc
 CXFLAGS ?= -ggdb
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED