From patchwork Sun Dec 20 14:39:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Weil X-Patchwork-Id: 41507 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 0E512B6F10 for ; Mon, 21 Dec 2009 01:39:53 +1100 (EST) Received: from localhost ([127.0.0.1]:56661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMMwo-0006XR-9k for incoming@patchwork.ozlabs.org; Sun, 20 Dec 2009 09:39:50 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NMMwM-0006Ws-VB for qemu-devel@nongnu.org; Sun, 20 Dec 2009 09:39:23 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NMMwH-0006W4-MJ for qemu-devel@nongnu.org; Sun, 20 Dec 2009 09:39:21 -0500 Received: from [199.232.76.173] (port=59343 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NMMwH-0006W1-G5 for qemu-devel@nongnu.org; Sun, 20 Dec 2009 09:39:17 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:55614) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NMMwG-000435-VN for qemu-devel@nongnu.org; Sun, 20 Dec 2009 09:39:17 -0500 Received: from flocke.weilnetz.de (p54ADC984.dip.t-dialin.net [84.173.201.132]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0MEaNR-1NG05j2qhF-00FZud; Sun, 20 Dec 2009 15:39:07 +0100 Received: from stefan by flocke.weilnetz.de with local (Exim 4.69) (envelope-from ) id 1NMMw5-0002Pk-Kv; Sun, 20 Dec 2009 15:39:05 +0100 From: Stefan Weil To: quintela@trasno.org, QEMU Developers Date: Sun, 20 Dec 2009 15:39:03 +0100 Message-Id: <1261319943-9224-1-git-send-email-weil@mail.berlios.de> X-Mailer: git-send-email 1.6.5 In-Reply-To: References: X-Provags-ID: V01U2FsdGVkX181SO46kjJb3KEwLaVBKAGzsKjx97ymod/lJte vs0VY7jKo5O3MlXpBnTR4NjqB39BsGzDz4h61wxnHBTm4fCofV DY/+p/MkES7qCc+j+uaIZ6A/eELDsnSfHUDY65afirOb4VWrZc OQQ== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Cc: Subject: [Qemu-devel] [PATCH] Makefile: Update unmodified config-devices.mak automatically 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 makes rebuilds after source updates easier for most users (who don't edit config-devices.mak). Signed-off-by: Stefan Weil --- 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: