Re: [U-Boot] [PATCH 1/2] common: Add CCACHE variable to allow use of ccache

2013-05-21 Thread Wolfgang Denk
Dear Marek Vasut,

In message 1369070715-9585-2-git-send-email-ma...@denx.de you wrote:
 Prefix HOSTCC and CC with CCACHE variable to allow easy use of ccache.
 In case the user wants to use ccache, exporting CCACHE=ccache will do
 the trick. It is of course possible to either make the cross-compiler
 name into a shellscript which invokes the ccache and the compiler, but
 setting this variable makes use of ccache easier and more convenient.
...
 -AS   = $(CROSS_COMPILE)as
 +AS   = $(CCACHE) $(CROSS_COMPILE)as
  
  # Always use GNU ld
  LD   = $(shell if $(CROSS_COMPILE)ld.bfd -v  /dev/null 21; \
   then echo $(CROSS_COMPILE)ld.bfd; else echo 
 $(CROSS_COMPILE)ld; fi;)
  
 -CC   = $(CROSS_COMPILE)gcc
 +CC   = $(CCACHE) $(CROSS_COMPILE)gcc
  CPP  = $(CC) -E

Why not for CPP ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
The use of Microsoft crippleware systems is a sin that  carries  with
it its own punishment.
 -- Tom Christiansen in 6bo3fr$pj8$5...@csnews.cs.colorado.edu
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 1/2] common: Add CCACHE variable to allow use of ccache

2013-05-21 Thread Marek Vasut
Dear Wolfgang Denk,

 Dear Marek Vasut,
 
 In message 1369070715-9585-2-git-send-email-ma...@denx.de you wrote:
  Prefix HOSTCC and CC with CCACHE variable to allow easy use of ccache.
  In case the user wants to use ccache, exporting CCACHE=ccache will do
  the trick. It is of course possible to either make the cross-compiler
  name into a shellscript which invokes the ccache and the compiler, but
  setting this variable makes use of ccache easier and more convenient.
 
 ...
 
  -AS = $(CROSS_COMPILE)as
  +AS = $(CCACHE) $(CROSS_COMPILE)as
  
   # Always use GNU ld
   LD = $(shell if $(CROSS_COMPILE)ld.bfd -v  /dev/null 21; \
   
  then echo $(CROSS_COMPILE)ld.bfd; else echo 
$(CROSS_COMPILE)ld;
  fi;)
  
  -CC = $(CROSS_COMPILE)gcc
  +CC = $(CCACHE) $(CROSS_COMPILE)gcc
  
   CPP= $(CC) -E
 
 Why not for CPP ?

CPP is invoked via $(CC) -E and CCACHE is set for CC right above, so that'd 
call 
ccache twice.

Best regards,
Marek Vasut
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


[U-Boot] [PATCH 1/2] common: Add CCACHE variable to allow use of ccache

2013-05-20 Thread Marek Vasut
Prefix HOSTCC and CC with CCACHE variable to allow easy use of ccache.
In case the user wants to use ccache, exporting CCACHE=ccache will do
the trick. It is of course possible to either make the cross-compiler
name into a shellscript which invokes the ccache and the compiler, but
setting this variable makes use of ccache easier and more convenient.

Using ccache becomes convenient when using MAKEALL for large build
tests, where the speedup after building the cache for the first time
is about 4-6 times.

Signed-off-by: Marek Vasut ma...@denx.de
Cc: Tom Rini tr...@ti.com
---
 config.mk |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/config.mk b/config.mk
index 1fd109f..d59ded2 100644
--- a/config.mk
+++ b/config.mk
@@ -98,6 +98,8 @@ else
 HOSTCC = gcc
 endif
 
+HOSTCC := $(CCACHE) $(HOSTCC)
+
 ifeq ($(HOSTOS),cygwin)
 HOSTCFLAGS += -ansi
 endif
@@ -140,13 +142,13 @@ binutils-version = $(shell $(SHELL) 
$(SRCTREE)/tools/binutils-version.sh $(AS))
 #
 # Include the make variables (CC, etc...)
 #
-AS = $(CROSS_COMPILE)as
+AS = $(CCACHE) $(CROSS_COMPILE)as
 
 # Always use GNU ld
 LD = $(shell if $(CROSS_COMPILE)ld.bfd -v  /dev/null 21; \
then echo $(CROSS_COMPILE)ld.bfd; else echo 
$(CROSS_COMPILE)ld; fi;)
 
-CC = $(CROSS_COMPILE)gcc
+CC = $(CCACHE) $(CROSS_COMPILE)gcc
 CPP= $(CC) -E
 AR = $(CROSS_COMPILE)ar
 NM = $(CROSS_COMPILE)nm
@@ -320,7 +322,7 @@ endif
 
 #
 
-export HOSTCC HOSTCFLAGS HOSTLDFLAGS PEDCFLAGS HOSTSTRIP CROSS_COMPILE \
+export HOSTCC HOSTCFLAGS HOSTLDFLAGS PEDCFLAGS HOSTSTRIP CROSS_COMPILE CCACHE \
AS LD CC CPP AR NM STRIP OBJCOPY OBJDUMP MAKE
 export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS 
CFLAGS AFLAGS
 
-- 
1.7.10.4

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot