qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: quintela@trasno.org, QEMU Developers <qemu-devel@nongnu.org>
Subject: [Qemu-devel] [PATCH] Makefile: Update unmodified config-devices.mak automatically
Date: Sun, 20 Dec 2009 15:39:03 +0100	[thread overview]
Message-ID: <1261319943-9224-1-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <m3r5rl376u.fsf@neno.neno>

This makes rebuilds after source updates easier
for most users (who don't edit config-devices.mak).

Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 Makefile |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index c1fa08c..684365d 100644
--- a/Makefile
+++ b/Makefile
@@ -43,12 +43,22 @@ config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
 
 %/config-devices.mak: default-configs/%.mak
 	$(call quiet-command,cat $< > $@.tmp, "  GEN   $@")
-	@if test -f $@ ; then \
-	  echo "WARNING: $@ out of date." ;\
-	  echo "Run \"make defconfig\" to regenerate." ; \
-	  rm $@.tmp ; \
+	@if test -f $@; then \
+	  if cmp -s $@.old $@ || cmp -s $@ $@.tmp; then \
+	    mv $@.tmp $@; \
+	    cp -p $@ $@.old; \
+	  else \
+	    if test -f $@.old; then \
+	      echo "WARNING: $@ (user modified) out of date.";\
+	    else \
+	      echo "WARNING: $@ out of date.";\
+	    fi; \
+	    echo "Run \"make defconfig\" to regenerate."; \
+	    rm $@.tmp; \
+	  fi; \
 	 else \
-	  mv $@.tmp $@ ; \
+	  mv $@.tmp $@; \
+	  cp -p $@ $@.old; \
 	 fi
 
 defconfig:
-- 
1.6.5

       reply	other threads:[~2009-12-20 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <m3r5rl376u.fsf@neno.neno>
2009-12-20 14:39 ` Stefan Weil [this message]
     [not found]   ` <20091224125823.GA31587@redhat.com>
     [not found]     ` <4B336D4E.2000707@mail.berlios.de>
     [not found]       ` <20091224134057.GA31674@redhat.com>
     [not found]         ` <m37hscct3e.fsf@neno.neno>
     [not found]           ` <20091224150611.GA422@redhat.com>
2010-01-05 21:25             ` [Qemu-devel] Re: [PATCH] Makefile: Update unmodified config-devices.mak automatically Stefan Weil
2010-01-08 16:34   ` [Qemu-devel] " Anthony Liguori

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=1261319943-9224-1-git-send-email-weil@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@trasno.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).