From patchwork Tue Jan 15 16:36:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 212225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CD8342C00A5 for ; Wed, 16 Jan 2013 03:33:26 +1100 (EST) Received: from localhost ([::1]:41740 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9Rz-0005yT-VT for incoming@patchwork.ozlabs.org; Tue, 15 Jan 2013 11:33:23 -0500 Received: from eggs.gnu.org ([208.118.235.92]:57341) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9Ra-0005fA-9S for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:33:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tv9RS-0000Vs-O2 for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:32:58 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tv9RS-0000VX-FQ for qemu-devel@nongnu.org; Tue, 15 Jan 2013 11:32:50 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r0FGWn4u019392 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 15 Jan 2013 11:32:49 -0500 Received: from redhat.com ([10.35.212.26]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id r0FGWmmW014941 for ; Tue, 15 Jan 2013 11:32:48 -0500 Date: Tue, 15 Jan 2013 18:36:48 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1d73c0f05575b77c8d67c8c131966ff9294c8650.1358267772.git.mst@redhat.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/4] rules.mak: cleanup config generation rules X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This addresses two issues with config generation 1. rule generating timestamp has side effect. Thus cleanup on error does not work. 2. rule for handling timestamp is too generic. It can create any missing .h file. As a result when .h file is removed, build might try to create it using this rule which results in build errors. Signed-off-by: Michael S. Tsirkin --- rules.mak | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rules.mak b/rules.mak index 6d82c0d..d11a5b4 100644 --- a/rules.mak +++ b/rules.mak @@ -82,12 +82,11 @@ TRACETOOL=$(PYTHON) $(SRC_PATH)/scripts/tracetool.py # Generate timestamp files for .h include files -%.h: %.h-timestamp - @test -f $@ || cp $< $@ +config-%.h: config-%.h-timestamp + @cmp $< $@ >/dev/null 2>&1 || cp $< $@ -%.h-timestamp: %.mak - $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@, " GEN $(TARGET_DIR)$*.h") - @cmp $@ $*.h >/dev/null 2>&1 || cp $@ $*.h +config-%.h-timestamp: config-%.mak + $(call quiet-command, sh $(SRC_PATH)/scripts/create_config < $< > $@, " GEN $(TARGET_DIR)config-$*.h") # will delete the target of a rule if commands exit with a nonzero exit status .DELETE_ON_ERROR: