From patchwork Sun Dec 13 15:36:17 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 41038 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 4B724B7082 for ; Mon, 14 Dec 2009 02:39:56 +1100 (EST) Received: from localhost ([127.0.0.1]:55194 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJqY5-0003Fk-4v for incoming@patchwork.ozlabs.org; Sun, 13 Dec 2009 10:39:53 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NJqXW-0003EX-N7 for qemu-devel@nongnu.org; Sun, 13 Dec 2009 10:39:18 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NJqXR-0003BG-Va for qemu-devel@nongnu.org; Sun, 13 Dec 2009 10:39:18 -0500 Received: from [199.232.76.173] (port=57185 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NJqXR-0003B8-LE for qemu-devel@nongnu.org; Sun, 13 Dec 2009 10:39:13 -0500 Received: from mx1.redhat.com ([209.132.183.28]:31650) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NJqXR-0005CX-6E for qemu-devel@nongnu.org; Sun, 13 Dec 2009 10:39:13 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nBDFd3QL013542 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Dec 2009 10:39:03 -0500 Received: from redhat.com (vpn-6-130.tlv.redhat.com [10.35.6.130]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with SMTP id nBDFcxMq019888; Sun, 13 Dec 2009 10:39:01 -0500 Date: Sun, 13 Dec 2009 17:36:17 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org, Anthony Liguori , paul@codesourcery.com Message-ID: <20091213153617.GA19576@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] Makefile: avoid defconfig annoyance X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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)