qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org, Anthony Liguori <anthony@codemonkey.ws>,
	paul@codesourcery.com
Subject: [Qemu-devel] [PATCH] Makefile: avoid defconfig annoyance
Date: Sun, 13 Dec 2009 17:36:17 +0200	[thread overview]
Message-ID: <20091213153617.GA19576@redhat.com> (raw)

This will be the last time you get
'config-devices.mak out of date' warning.

We have a config-devices.mak feature, which
makes it possile for distros to disable devices
they do not want. However, this is annoyng
for development where you just want
to use the default most of the time.

We want to distinguish between user overriding
config manually and just updating from git.
Do this, by sticking include directive in the generated files,
and avoiding error if the generated file only has such include
directives.

This patch is also careful to:
- not print warning while defconfig target is run
- tell user what will happen if make defconfig is run
  instead of just telling her what to do
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 Makefile |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index a662d96..469ce43 100644
--- a/Makefile
+++ b/Makefile
@@ -39,18 +39,21 @@ SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory)
 SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS))
 
 config-all-devices.mak: $(SUBDIR_DEVICES_MAK)
-	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | grep =y | sort -u > $@,"  GEN   $@")
+	$(call quiet-command,cat $(SUBDIR_DEVICES_MAK) | \
+		grep -e =y -e ^-include | sort -u > $@,"  GEN   $@")
 
 %/config-devices.mak: default-configs/%.mak
-	$(call quiet-command,cat $< > $@.tmp, "  GEN   $@")
-	@if test -f $@ ; then \
+	$(call quiet-command,echo '-include $<'> $@.tmp, "  GEN   $@")
+	@if test -z "${QEMU_MAKE_DEFCONFIG}" -a -f $@ && \
+            grep -v '^-?include' $@ ; then \
 	  echo "WARNING: $@ out of date." ;\
-	  echo "Run \"make defconfig\" to regenerate." ; \
+	  echo "Update it or run \"make defconfig\" to remove it." ; \
 	  rm $@.tmp ; \
 	 else \
 	  mv $@.tmp $@ ; \
 	 fi
 
+defconfig: QEMU_MAKE_DEFCONFIG=yes
 defconfig:
 	rm -f config-all-devices.mak $(SUBDIR_DEVICES_MAK)
 
-- 
1.6.6.rc1.43.gf55cc

                 reply	other threads:[~2009-12-13 15:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20091213153617.GA19576@redhat.com \
    --to=mst@redhat.com \
    --cc=anthony@codemonkey.ws \
    --cc=paul@codesourcery.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 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).