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

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

From: NeilBrown <hidden>
Date: 2013-06-19 00:07:30

On Tue, 18 Jun 2013 11:09:21 +0200 Bernd Schubert
[off-list ref] wrote:
Users might want to compile with optimization levels and
CXFLAGS as suggested in the Makefile comment does not work.
Doesn't it?  It works for me.

   make CXFLAGS=-O3

compiled with "-O3".


I haven't applied this patch (feel free to try to be more convincing) but has
applied all the others (after removing a little bit of trailing white space).

Thanks,
NeilBrown

quoted hunk ↗ jump to hunk
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
  

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help