All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: Blue Swirl <blauwirbel@gmail.com>, qemu-devel <qemu-devel@nongnu.org>
Subject: [Qemu-devel] Re: [PATCH 2/2] trace: avoid unnecessary recompilation if nothing changed
Date: Mon, 27 Sep 2010 11:51:52 +0200	[thread overview]
Message-ID: <4CA06938.7030106@redhat.com> (raw)
In-Reply-To: <m3bp7j8u3n.fsf@blackfin.pond.sub.org>

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.
> 
>      armbru@blackfin:~/tmp$ cat Makefile
>      foo: bar
>              echo "Remaking foo"
> 
>      bar:
>              [ -f $@ ] || touch $@&&  echo "Touched bar"
>      armbru@blackfin:~/tmp$ rm -f foo
>      armbru@blackfin:~/tmp$ make
>      [ -f bar ] || touch bar&&  echo "Touched bar"
>      Touched bar
>      echo "Remaking foo"
>      Remaking foo
>      armbru@blackfin:~/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)
	@cmp $@ trace.h >/dev/null 2>&1 || cp $@ trace.h

(untested).

Paolo

  reply	other threads:[~2010-09-27 10:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-26  9:05 [Qemu-devel] [PATCH 2/2] trace: avoid unnecessary recompilation if nothing changed Blue Swirl
2010-09-26 16:15 ` Stefan Hajnoczi
2010-09-27  8:32 ` Markus Armbruster
2010-09-27  9:51   ` Paolo Bonzini [this message]
2010-09-27 16:13     ` [Qemu-devel] " Blue Swirl
2010-09-27 16:16       ` Paolo Bonzini
2010-09-28  8:58   ` [Qemu-devel] " Markus Armbruster
2010-09-29 11:42     ` [Qemu-devel] " Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CA06938.7030106@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=armbru@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.