Thread (21 messages) 21 messages, 3 authors, 2013-06-28
STALE4749d

[PATCH 2/6] Makefile: Allow the user to pass EXTRA_CFLAGS

From: Bernd Schubert <hidden>
Date: 2013-06-18 09:09:21
Subsystem: kernel build + files below scripts/ (unless maintained elsewhere), the rest · Maintainers: Nathan Chancellor, Nicolas Schier, Linus Torvalds

Users might want to compile with optimization levels and
CXFLAGS as suggested in the Makefile comment does not work.

Signed-off-by: Bernd Schubert <redacted>
---
 Makefile |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 8cb8d51..09e08fa 100644
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,8 @@
 #           Australia
 #
 
-# define "CXFLAGS" to give extra flags to CC.
-# e.g.  make CXFLAGS=-O to optimise
+# define "EXTRA_CFLAGS" to give extra flags to CC.
+# e.g.  make EXTRA_CFLAGS=-O to optimise
 TCC = tcc
 UCLIBC_GCC = $(shell for nm in i386-uclibc-linux-gcc i386-uclibc-gcc; do which $$nm > /dev/null && { echo $$nm ; exit; } ; done; echo false No uclibc found )
 #DIET_GCC = diet gcc
@@ -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
-CXFLAGS = -ggdb
+CXFLAGS = -ggdb $(EXTRA_CFLAGS)
 CWFLAGS = -Wall -Werror -Wstrict-prototypes -Wextra -Wno-unused-parameter
 ifdef WARN_UNUSED
 CWFLAGS += -Wp,-D_FORTIFY_SOURCE=2 -O
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help