diff mbox

Makefile: Take advantage of ccache automatically

Message ID 1396018274-11489-1-git-send-email-mike.holmes@linaro.org
State Rejected
Headers show

Commit Message

Mike Holmes March 28, 2014, 2:51 p.m. UTC
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
---
 Makefile.inc | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Steve McIntyre March 28, 2014, 3:34 p.m. UTC | #1
Is ccache important enough that it's worth adding explicitly to the
Makefile here? Users can simply add it themselves directly on the
command line, surely?

On Fri, Mar 28, 2014 at 10:51:14AM -0400, Mike Holmes wrote:
>Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>---
> Makefile.inc | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
>diff --git a/Makefile.inc b/Makefile.inc
>index a5aeb8b..dde09a9 100644
>--- a/Makefile.inc
>+++ b/Makefile.inc
>@@ -7,7 +7,6 @@ PLATFORM ?= linux-generic
> OBJ_DIR   = ./obj
> ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
> 
>-
> CC     ?= gcc
> LD     ?= gcc
> AR     ?= ar
>@@ -17,6 +16,12 @@ RMDIR  := rm -rf
> RM     := rm -f
> COPY   := cp -r
> 
>+CCACHE_EXISTS := $(shell ccache -V)
>+ifdef CCACHE_EXISTS
>+    CC := ccache $(CC)
>+    CXX := ccache $(CXX)
>+endif
>+
> EXTRA_CFLAGS += -DODP_DEBUG=1
> EXTRA_CFLAGS += -O3
> #EXTRA_CFLAGS += -O0 -g

Cheers,
Mike Holmes March 28, 2014, 3:43 p.m. UTC | #2
I find it valuable, so I assumed others might, it does no harm if you dont
have it.


On 28 March 2014 11:34, Steve McIntyre <steve.mcintyre@linaro.org> wrote:

> Is ccache important enough that it's worth adding explicitly to the
> Makefile here? Users can simply add it themselves directly on the
> command line, surely?
>
> On Fri, Mar 28, 2014 at 10:51:14AM -0400, Mike Holmes wrote:
> >Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
> >---
> > Makefile.inc | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> >diff --git a/Makefile.inc b/Makefile.inc
> >index a5aeb8b..dde09a9 100644
> >--- a/Makefile.inc
> >+++ b/Makefile.inc
> >@@ -7,7 +7,6 @@ PLATFORM ?= linux-generic
> > OBJ_DIR   = ./obj
> > ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
> >
> >-
> > CC     ?= gcc
> > LD     ?= gcc
> > AR     ?= ar
> >@@ -17,6 +16,12 @@ RMDIR  := rm -rf
> > RM     := rm -f
> > COPY   := cp -r
> >
> >+CCACHE_EXISTS := $(shell ccache -V)
> >+ifdef CCACHE_EXISTS
> >+    CC := ccache $(CC)
> >+    CXX := ccache $(CXX)
> >+endif
> >+
> > EXTRA_CFLAGS += -DODP_DEBUG=1
> > EXTRA_CFLAGS += -O3
> > #EXTRA_CFLAGS += -O0 -g
>
> Cheers,
> --
> Steve McIntyre                                steve.mcintyre@linaro.org
> <http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs
>
>
Mike Holmes March 28, 2014, 4:02 p.m. UTC | #3
Two more supporting cases

ccache is not that valuable for the linux-generic, but hopefully there are
more implementations than that out there.
In CI we build multiple flavors and it helps there.


On 28 March 2014 11:43, Mike Holmes <mike.holmes@linaro.org> wrote:

> I find it valuable, so I assumed others might, it does no harm if you dont
> have it.
>
>
> On 28 March 2014 11:34, Steve McIntyre <steve.mcintyre@linaro.org> wrote:
>
>> Is ccache important enough that it's worth adding explicitly to the
>> Makefile here? Users can simply add it themselves directly on the
>> command line, surely?
>>
>> On Fri, Mar 28, 2014 at 10:51:14AM -0400, Mike Holmes wrote:
>> >Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>> >---
>> > Makefile.inc | 7 ++++++-
>> > 1 file changed, 6 insertions(+), 1 deletion(-)
>> >
>> >diff --git a/Makefile.inc b/Makefile.inc
>> >index a5aeb8b..dde09a9 100644
>> >--- a/Makefile.inc
>> >+++ b/Makefile.inc
>> >@@ -7,7 +7,6 @@ PLATFORM ?= linux-generic
>> > OBJ_DIR   = ./obj
>> > ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
>> >
>> >-
>> > CC     ?= gcc
>> > LD     ?= gcc
>> > AR     ?= ar
>> >@@ -17,6 +16,12 @@ RMDIR  := rm -rf
>> > RM     := rm -f
>> > COPY   := cp -r
>> >
>> >+CCACHE_EXISTS := $(shell ccache -V)
>> >+ifdef CCACHE_EXISTS
>> >+    CC := ccache $(CC)
>> >+    CXX := ccache $(CXX)
>> >+endif
>> >+
>> > EXTRA_CFLAGS += -DODP_DEBUG=1
>> > EXTRA_CFLAGS += -O3
>> > #EXTRA_CFLAGS += -O0 -g
>>
>> Cheers,
>> --
>> Steve McIntyre                                steve.mcintyre@linaro.org
>> <http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs
>>
>>
>
Steve McIntyre March 28, 2014, 4:28 p.m. UTC | #4
Fair enough, I just haven't seen explicit ccache support in many
upstream project Makefiles. That's all... :-)

On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote:
>Two more supporting cases
>
>ccache is not that valuable for the linux-generic, but hopefully there are more
>implementations than that out there.
>In CI we build multiple flavors and it helps there.
>
>
>On 28 March 2014 11:43, Mike Holmes <mike.holmes@linaro.org> wrote:
>
>    I find it valuable, so I assumed others might, it does no harm if you dont
>    have it.
>
>
>    On 28 March 2014 11:34, Steve McIntyre <steve.mcintyre@linaro.org> wrote:
>
>        Is ccache important enough that it's worth adding explicitly to the
>        Makefile here? Users can simply add it themselves directly on the
>        command line, surely?
>
>        On Fri, Mar 28, 2014 at 10:51:14AM -0400, Mike Holmes wrote:
>        >Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
>        >---
>        > Makefile.inc | 7 ++++++-
>        > 1 file changed, 6 insertions(+), 1 deletion(-)
>        >
>        >diff --git a/Makefile.inc b/Makefile.inc
>        >index a5aeb8b..dde09a9 100644
>        >--- a/Makefile.inc
>        >+++ b/Makefile.inc
>        >@@ -7,7 +7,6 @@ PLATFORM ?= linux-generic
>        > OBJ_DIR   = ./obj
>        > ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
>        >
>        >-
>        > CC     ?= gcc
>        > LD     ?= gcc
>        > AR     ?= ar
>        >@@ -17,6 +16,12 @@ RMDIR  := rm -rf
>        > RM     := rm -f
>        > COPY   := cp -r
>        >
>        >+CCACHE_EXISTS := $(shell ccache -V)
>        >+ifdef CCACHE_EXISTS
>        >+    CC := ccache $(CC)
>        >+    CXX := ccache $(CXX)
>        >+endif
>        >+
>        > EXTRA_CFLAGS += -DODP_DEBUG=1
>        > EXTRA_CFLAGS += -O3
>        > #EXTRA_CFLAGS += -O0 -g
>
>        Cheers,
>        --
>        Steve McIntyre                                steve.mcintyre@linaro.org
>        <http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs
>
>   
>
>
>
Cheers,
Mike Holmes March 28, 2014, 4:31 p.m. UTC | #5
I just want to stop adding it every time by hand :)

On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>
> Fair enough, I just haven't seen explicit ccache support in many 
> upstream project Makefiles. That's all... :-) 
>
> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote: 
> >Two more supporting cases 
> > 
> >ccache is not that valuable for the linux-generic, but hopefully there 
> are more 
> >implementations than that out there. 
> >In CI we build multiple flavors and it helps there. 
> > 
> > 
> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org <javascript:>> 
> wrote: 
> > 
> >    I find it valuable, so I assumed others might, it does no harm if you 
> dont 
> >    have it. 
> > 
> > 
> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org<javascript:>> 
> wrote: 
> > 
> >        Is ccache important enough that it's worth adding explicitly to 
> the 
> >        Makefile here? Users can simply add it themselves directly on the 
> >        command line, surely? 
> > 
> >        On Fri, Mar 28, 2014 at 10:51:14AM -0400, Mike Holmes wrote: 
> >        >Signed-off-by: Mike Holmes <mike....@linaro.org <javascript:>> 
> >        >--- 
> >        > Makefile.inc | 7 ++++++- 
> >        > 1 file changed, 6 insertions(+), 1 deletion(-) 
> >        > 
> >        >diff --git a/Makefile.inc b/Makefile.inc 
> >        >index a5aeb8b..dde09a9 100644 
> >        >--- a/Makefile.inc 
> >        >+++ b/Makefile.inc 
> >        >@@ -7,7 +7,6 @@ PLATFORM ?= linux-generic 
> >        > OBJ_DIR   = ./obj 
> >        > ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM) 
> >        > 
> >        >- 
> >        > CC     ?= gcc 
> >        > LD     ?= gcc 
> >        > AR     ?= ar 
> >        >@@ -17,6 +16,12 @@ RMDIR  := rm -rf 
> >        > RM     := rm -f 
> >        > COPY   := cp -r 
> >        > 
> >        >+CCACHE_EXISTS := $(shell ccache -V) 
> >        >+ifdef CCACHE_EXISTS 
> >        >+    CC := ccache $(CC) 
> >        >+    CXX := ccache $(CXX) 
> >        >+endif 
> >        >+ 
> >        > EXTRA_CFLAGS += -DODP_DEBUG=1 
> >        > EXTRA_CFLAGS += -O3 
> >        > #EXTRA_CFLAGS += -O0 -g 
> > 
> >        Cheers, 
> >        -- 
> >        Steve McIntyre                                
> steve.m...@linaro.org <javascript:> 
> >        <http://www.linaro.org/> Linaro.org | Open source software for 
> ARM SoCs 
> > 
> >   
> > 
> > 
> > 
> Cheers, 
> -- 
> Steve McIntyre                                steve.m...@linaro.org<javascript:> 
> <http://www.linaro.org/> Linaro.org | Open source software for ARM SoCs 
>
>
Petri Savolainen March 31, 2014, 8:02 a.m. UTC | #6
Hi,

Agree with Steve - there's surely a CI loop script already that does the 
make call. Why not add CC=ccache there? Makefiles should optimized for the 
"normal" user. There's only one "CI loop" user.

-Petri


On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>
> I just want to stop adding it every time by hand :)
>
> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>
>> Fair enough, I just haven't seen explicit ccache support in many 
>> upstream project Makefiles. That's all... :-) 
>>
>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote: 
>> >Two more supporting cases 
>> > 
>> >ccache is not that valuable for the linux-generic, but hopefully there 
>> are more 
>> >implementations than that out there. 
>> >In CI we build multiple flavors and it helps there. 
>> > 
>> > 
>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote: 
>> > 
>> >    I find it valuable, so I assumed others might, it does no harm if 
>> you dont 
>> >    have it. 
>> > 
>> > 
>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org> 
>> wrote: 
>> > 
>> >        Is ccache important enough that it's worth adding explicitly to 
>> the 
>> >        Makefile here? Users can simply add it themselves directly on 
>> the 
>> >        command line, surely? 
>>
>>
Mike Holmes March 31, 2014, 4:25 p.m. UTC | #7
And what about anyone who has to build their platforms RTE ? That takes
quite a while.

Mike


On 31 March 2014 04:02, Petri Savolainen <petri.savolainen@linaro.org>wrote:

> Hi,
>
> Agree with Steve - there's surely a CI loop script already that does the
> make call. Why not add CC=ccache there? Makefiles should optimized for the
> "normal" user. There's only one "CI loop" user.
>
> -Petri
>
>
>
> On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>>
>> I just want to stop adding it every time by hand :)
>>
>> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>>
>>> Fair enough, I just haven't seen explicit ccache support in many
>>> upstream project Makefiles. That's all... :-)
>>>
>>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote:
>>> >Two more supporting cases
>>> >
>>> >ccache is not that valuable for the linux-generic, but hopefully there
>>> are more
>>> >implementations than that out there.
>>> >In CI we build multiple flavors and it helps there.
>>> >
>>> >
>>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote:
>>> >
>>> >    I find it valuable, so I assumed others might, it does no harm if
>>> you dont
>>> >    have it.
>>> >
>>> >
>>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org>
>>> wrote:
>>> >
>>> >        Is ccache important enough that it's worth adding explicitly to
>>> the
>>> >        Makefile here? Users can simply add it themselves directly on
>>> the
>>> >        command line, surely?
>>>
>>>
Petri Savolainen April 1, 2014, 12:22 p.m. UTC | #8
Hi,

If you modify ODP app or implementation files, you would not re-build the 
whole SDK/RTE every time from sources, right? Is ccache needed still 
needed, if RTE is a library and makefile dependencies are defined correctly?

-Petri


On Monday, 31 March 2014 19:25:53 UTC+3, Mike Holmes wrote:
>
> And what about anyone who has to build their platforms RTE ? That takes 
> quite a while.
>
> Mike
>
>
> On 31 March 2014 04:02, Petri Savolainen <petri.sa...@linaro.org<javascript:>
> > wrote:
>
>> Hi,
>>
>> Agree with Steve - there's surely a CI loop script already that does the 
>> make call. Why not add CC=ccache there? Makefiles should optimized for the 
>> "normal" user. There's only one "CI loop" user.
>>
>> -Petri
>>
>>
>>
>> On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>>>
>>> I just want to stop adding it every time by hand :)
>>>
>>> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>>>
>>>> Fair enough, I just haven't seen explicit ccache support in many 
>>>> upstream project Makefiles. That's all... :-) 
>>>>
>>>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote: 
>>>> >Two more supporting cases 
>>>> > 
>>>> >ccache is not that valuable for the linux-generic, but hopefully there 
>>>> are more 
>>>> >implementations than that out there. 
>>>> >In CI we build multiple flavors and it helps there. 
>>>> > 
>>>> > 
>>>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote: 
>>>> > 
>>>> >    I find it valuable, so I assumed others might, it does no harm if 
>>>> you dont 
>>>> >    have it. 
>>>> > 
>>>> > 
>>>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org> 
>>>> wrote: 
>>>> > 
>>>> >        Is ccache important enough that it's worth adding explicitly 
>>>> to the 
>>>> >        Makefile here? Users can simply add it themselves directly on 
>>>> the 
>>>> >        command line, surely? 
>>>>
>>>>
>
Mike Holmes April 1, 2014, 12:27 p.m. UTC | #9
I'm fine there if there is such resistance to let it go, but given that it
does no harm I wonder why it is not a good idea.


On 1 April 2014 08:22, Petri Savolainen <petri.savolainen@linaro.org> wrote:

> Hi,
>
> If you modify ODP app or implementation files, you would not re-build the
> whole SDK/RTE every time from sources, right? Is ccache needed still
> needed, if RTE is a library and makefile dependencies are defined correctly?
>
> -Petri
>
>
>
> On Monday, 31 March 2014 19:25:53 UTC+3, Mike Holmes wrote:
>
>> And what about anyone who has to build their platforms RTE ? That takes
>> quite a while.
>>
>> Mike
>>
>>
>> On 31 March 2014 04:02, Petri Savolainen <petri.sa...@linaro.org> wrote:
>>
>>> Hi,
>>>
>>> Agree with Steve - there's surely a CI loop script already that does the
>>> make call. Why not add CC=ccache there? Makefiles should optimized for the
>>> "normal" user. There's only one "CI loop" user.
>>>
>>> -Petri
>>>
>>>
>>>
>>> On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>>>>
>>>> I just want to stop adding it every time by hand :)
>>>>
>>>> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>>>>
>>>>> Fair enough, I just haven't seen explicit ccache support in many
>>>>> upstream project Makefiles. That's all... :-)
>>>>>
>>>>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote:
>>>>> >Two more supporting cases
>>>>> >
>>>>> >ccache is not that valuable for the linux-generic, but hopefully
>>>>> there are more
>>>>> >implementations than that out there.
>>>>> >In CI we build multiple flavors and it helps there.
>>>>> >
>>>>> >
>>>>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote:
>>>>> >
>>>>> >    I find it valuable, so I assumed others might, it does no harm if
>>>>> you dont
>>>>> >    have it.
>>>>> >
>>>>> >
>>>>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org>
>>>>> wrote:
>>>>> >
>>>>> >        Is ccache important enough that it's worth adding explicitly
>>>>> to the
>>>>> >        Makefile here? Users can simply add it themselves directly on
>>>>> the
>>>>> >        command line, surely?
>>>>>
>>>>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-0a727ace618f%40linaro.org<https://groups.google.com/a/linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-0a727ace618f%40linaro.org?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/a/linaro.org/d/optout.
>
Petri Savolainen April 1, 2014, 12:34 p.m. UTC | #10
Hi,

The harm is less readable makefiles. If we add this (and couple of other 
similar things) it becomes less obvious e.g. what the CC is in system XYZ 
(which is pretty important thing to know e.g. when hunting bugs).

-Petri 



On Tuesday, 1 April 2014 15:27:08 UTC+3, Mike Holmes wrote:
>
> I'm fine there if there is such resistance to let it go, but given that it 
> does no harm I wonder why it is not a good idea.
>
>
> On 1 April 2014 08:22, Petri Savolainen <petri.sa...@linaro.org<javascript:>
> > wrote:
>
>> Hi,
>>
>> If you modify ODP app or implementation files, you would not re-build the 
>> whole SDK/RTE every time from sources, right? Is ccache needed still 
>> needed, if RTE is a library and makefile dependencies are defined correctly?
>>
>> -Petri
>>
>>
>>
>> On Monday, 31 March 2014 19:25:53 UTC+3, Mike Holmes wrote:
>>
>>> And what about anyone who has to build their platforms RTE ? That takes 
>>> quite a while.
>>>
>>> Mike
>>>
>>>
>>> On 31 March 2014 04:02, Petri Savolainen <petri.sa...@linaro.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> Agree with Steve - there's surely a CI loop script already that does 
>>>> the make call. Why not add CC=ccache there? Makefiles should optimized for 
>>>> the "normal" user. There's only one "CI loop" user.
>>>>
>>>> -Petri
>>>>
>>>>
>>>>
>>>> On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>>>>>
>>>>> I just want to stop adding it every time by hand :)
>>>>>
>>>>> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>>>>>
>>>>>> Fair enough, I just haven't seen explicit ccache support in many 
>>>>>> upstream project Makefiles. That's all... :-) 
>>>>>>
>>>>>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote: 
>>>>>> >Two more supporting cases 
>>>>>> > 
>>>>>> >ccache is not that valuable for the linux-generic, but hopefully 
>>>>>> there are more 
>>>>>> >implementations than that out there. 
>>>>>> >In CI we build multiple flavors and it helps there. 
>>>>>> > 
>>>>>> > 
>>>>>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote: 
>>>>>> > 
>>>>>> >    I find it valuable, so I assumed others might, it does no harm 
>>>>>> if you dont 
>>>>>> >    have it. 
>>>>>> > 
>>>>>> > 
>>>>>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org> 
>>>>>> wrote: 
>>>>>> > 
>>>>>> >        Is ccache important enough that it's worth adding explicitly 
>>>>>> to the 
>>>>>> >        Makefile here? Users can simply add it themselves directly 
>>>>>> on the 
>>>>>> >        command line, surely? 
>>>>>>
>>>>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "LNG ODP Sub-team - lng...@linaro.org <javascript:>" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to lng-odp+u...@linaro.org <javascript:>.
>> To post to this group, send email to lng...@linaro.org <javascript:>.
>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
>> To view this discussion on the web visit 
>> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-0a727ace618f%40linaro.org<https://groups.google.com/a/linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-0a727ace618f%40linaro.org?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/a/linaro.org/d/optout.
>>
>
>
Mike Holmes April 1, 2014, 12:43 p.m. UTC | #11
Ok, not convinced :)  but ok, drop the patch


On 1 April 2014 08:34, Petri Savolainen <petri.savolainen@linaro.org> wrote:

> Hi,
>
> The harm is less readable makefiles. If we add this (and couple of other
> similar things) it becomes less obvious e.g. what the CC is in system XYZ
> (which is pretty important thing to know e.g. when hunting bugs).
>
> -Petri
>
>
>
> On Tuesday, 1 April 2014 15:27:08 UTC+3, Mike Holmes wrote:
>
>> I'm fine there if there is such resistance to let it go, but given that
>> it does no harm I wonder why it is not a good idea.
>>
>>
>> On 1 April 2014 08:22, Petri Savolainen <petri.sa...@linaro.org> wrote:
>>
>>> Hi,
>>>
>>> If you modify ODP app or implementation files, you would not re-build
>>> the whole SDK/RTE every time from sources, right? Is ccache needed still
>>> needed, if RTE is a library and makefile dependencies are defined correctly?
>>>
>>> -Petri
>>>
>>>
>>>
>>> On Monday, 31 March 2014 19:25:53 UTC+3, Mike Holmes wrote:
>>>
>>>> And what about anyone who has to build their platforms RTE ? That takes
>>>> quite a while.
>>>>
>>>> Mike
>>>>
>>>>
>>>> On 31 March 2014 04:02, Petri Savolainen <petri.sa...@linaro.org>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Agree with Steve - there's surely a CI loop script already that does
>>>>> the make call. Why not add CC=ccache there? Makefiles should optimized for
>>>>> the "normal" user. There's only one "CI loop" user.
>>>>>
>>>>> -Petri
>>>>>
>>>>>
>>>>>
>>>>> On Friday, 28 March 2014 18:31:14 UTC+2, Mike Holmes wrote:
>>>>>>
>>>>>> I just want to stop adding it every time by hand :)
>>>>>>
>>>>>> On Friday, March 28, 2014 12:28:11 PM UTC-4, Steve McIntyre wrote:
>>>>>>>
>>>>>>> Fair enough, I just haven't seen explicit ccache support in many
>>>>>>> upstream project Makefiles. That's all... :-)
>>>>>>>
>>>>>>> On Fri, Mar 28, 2014 at 12:02:04PM -0400, Mike Holmes wrote:
>>>>>>> >Two more supporting cases
>>>>>>> >
>>>>>>> >ccache is not that valuable for the linux-generic, but hopefully
>>>>>>> there are more
>>>>>>> >implementations than that out there.
>>>>>>> >In CI we build multiple flavors and it helps there.
>>>>>>> >
>>>>>>> >
>>>>>>> >On 28 March 2014 11:43, Mike Holmes <mike....@linaro.org> wrote:
>>>>>>> >
>>>>>>> >    I find it valuable, so I assumed others might, it does no harm
>>>>>>> if you dont
>>>>>>> >    have it.
>>>>>>> >
>>>>>>> >
>>>>>>> >    On 28 March 2014 11:34, Steve McIntyre <steve.m...@linaro.org>
>>>>>>> wrote:
>>>>>>> >
>>>>>>> >        Is ccache important enough that it's worth adding
>>>>>>> explicitly to the
>>>>>>> >        Makefile here? Users can simply add it themselves directly
>>>>>>> on the
>>>>>>> >        command line, surely?
>>>>>>>
>>>>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "LNG ODP Sub-team - lng...@linaro.org" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to lng-odp+u...@linaro.org.
>>> To post to this group, send email to lng...@linaro.org.
>>>
>>> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/
>>> .
>>> To view this discussion on the web visit https://groups.google.com/a/
>>> linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-
>>> 0a727ace618f%40linaro.org<https://groups.google.com/a/linaro.org/d/msgid/lng-odp/c482664e-503c-4bb1-850e-0a727ace618f%40linaro.org?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/a/linaro.org/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "LNG ODP Sub-team - lng-odp@linaro.org" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to lng-odp+unsubscribe@linaro.org.
> To post to this group, send email to lng-odp@linaro.org.
> Visit this group at http://groups.google.com/a/linaro.org/group/lng-odp/.
> To view this discussion on the web visit
> https://groups.google.com/a/linaro.org/d/msgid/lng-odp/dcee796b-092f-4145-9c89-9ad39560655c%40linaro.org<https://groups.google.com/a/linaro.org/d/msgid/lng-odp/dcee796b-092f-4145-9c89-9ad39560655c%40linaro.org?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/a/linaro.org/d/optout.
>
diff mbox

Patch

diff --git a/Makefile.inc b/Makefile.inc
index a5aeb8b..dde09a9 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -7,7 +7,6 @@  PLATFORM ?= linux-generic
 OBJ_DIR   = ./obj
 ODP_DIR   = $(ODP_ROOT)/platform/$(PLATFORM)
 
-
 CC     ?= gcc
 LD     ?= gcc
 AR     ?= ar
@@ -17,6 +16,12 @@  RMDIR  := rm -rf
 RM     := rm -f
 COPY   := cp -r
 
+CCACHE_EXISTS := $(shell ccache -V)
+ifdef CCACHE_EXISTS
+    CC := ccache $(CC)
+    CXX := ccache $(CXX)
+endif
+
 EXTRA_CFLAGS += -DODP_DEBUG=1
 EXTRA_CFLAGS += -O3
 #EXTRA_CFLAGS += -O0 -g