[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] Re: [PATCH 2/2] trace: avoid unnecessary recompilation if n
From: |
Blue Swirl |
Subject: |
[Qemu-devel] Re: [PATCH 2/2] trace: avoid unnecessary recompilation if nothing changed |
Date: |
Mon, 27 Sep 2010 16:13:12 +0000 |
On Mon, Sep 27, 2010 at 9:51 AM, Paolo Bonzini <address@hidden> wrote:
> On 09/27/2010 10:32 AM, Markus Armbruster wrote:
>> Why the conditional? cmp -s fails fine when argument files don't exist.
>>
>> Note that common versions of make including GNU Make do not stat a
>> rule's target to check whether the rule changed it. Instead, they
>> assume it changed, and remake everything depending on it.
>>
>> address@hidden:~/tmp$ cat Makefile
>> foo: bar
>> echo "Remaking foo"
>>
>> bar:
>> [ -f $@ ] || touch $@&& echo "Touched bar"
>> address@hidden:~/tmp$ rm -f foo
>> address@hidden:~/tmp$ make
>> [ -f bar ] || touch bar&& echo "Touched bar"
>> Touched bar
>> echo "Remaking foo"
>> Remaking foo
>> address@hidden:~/tmp$ make
>> echo "Remaking foo"
>> Remaking foo
>>
>> I doubt your patch avoids churn as advertized with such makes.
>
> Indeed, see how it's done for config-*.h.
>
> # Uses generic rule in rules.mak
> trace.h: trace.h-timestamp
> trace.h-timestamp: $(SRC_PATH)/trace-events config-host.mak
> $(call quiet-command,sh $(SRC_PATH)/tracetool --$(TRACE_BACKEND) -h <
> $< > $@," GEN trace.h)
> address@hidden $@ trace.h >/dev/null 2>&1 || cp $@ trace.h
>
> (untested).
I just copied the rule from %/config-devices.mak. Is also that rule
then incorrect?
Perhaps there could be a macro for this, not unlike move-if-change
script in various GNU packages?