From patchwork Thu Mar 12 15:16:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 449525 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0ABCC1400EA for ; Fri, 13 Mar 2015 02:17:21 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="verification failed; unprotected key" header.d=gmail.com header.i=@gmail.com header.b=d4zyFtp/; dkim-adsp=none (unprotected policy); dkim-atps=neutral Received: from localhost ([::1]:60603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4rN-0004bW-Tx for incoming@patchwork.ozlabs.org; Thu, 12 Mar 2015 11:17:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4qn-0003u8-HB for qemu-devel@nongnu.org; Thu, 12 Mar 2015 11:16:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YW4qh-0004XG-Hc for qemu-devel@nongnu.org; Thu, 12 Mar 2015 11:16:41 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:45851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YW4qh-0004X3-Bn for qemu-devel@nongnu.org; Thu, 12 Mar 2015 11:16:35 -0400 Received: by wibbs8 with SMTP id bs8so21239887wib.4 for ; Thu, 12 Mar 2015 08:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=VSeuYDQE8nbqQ2mGHOg+ZWbwfRH2NhSoR9p3QoVwZTo=; b=d4zyFtp/gSrvH/IuQhAhW/sgxrR3ho/3kC7pr/EOWu0x6vl71ZoFW1rgs5OnT6K0UP t0tu5JJCpj+KppdhX/xF8O/yXZXa9lzh6T1TKc0rSkRIBTD4bb6MFU9wW+7rvbJJeOI3 6+x1qcL2gs883OX4+gVw0GBSubpZNVg4NwKRW9Tk3lDR7aTnT7xalUq6pG2fMH+KFPSB uUXo6Xx51e5+qy3i2nxcUrSaOVa1ibxfhOcy1AHffy8TrEB6x4+OrW1waFcsLzqA0GX8 N2dgVyKbLVaacWOW/Q/ihesbvb1db3SXb/7vOpEOBpqJY5t4GNT2uRij4p2Xd13jLxgt 22fw== X-Received: by 10.180.96.197 with SMTP id du5mr63152180wib.68.1426173394796; Thu, 12 Mar 2015 08:16:34 -0700 (PDT) Received: from donizetti.station (net-188-216-23-124.cust.vodafonedsl.it. [188.216.23.124]) by mx.google.com with ESMTPSA id uc18sm11204817wib.0.2015.03.12.08.16.32 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 08:16:33 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 12 Mar 2015 16:16:28 +0100 Message-Id: <1426173388-11796-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 2.3.0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22c Cc: peter.maydell@linaro.org, "Michael S. Tsirkin" Subject: [Qemu-devel] [PATCH] build: pass .d file name to scripts/make_device_config.sh, fix makefile target 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 The .d file name must match exactly what is used in the SUBDIR_DEVICES_MAK_DEP variable. Instead of making assumptions in the make_device_config.sh script, just pass it in. Similarly, the makefile target may not match the output file name, because Makefile uses a temporary file. Instead of making assumptions on what the Makefile does, emit the config-devices.mak file to stdout, and use the passed-in destination as the makefile target Reported-by: Peter Maydell Cc: Michael S. Tsirkin Signed-off-by: Paolo Bonzini --- Makefile | 3 ++- scripts/make_device_config.sh | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 884b59d..88bce56 100644 --- a/Makefile +++ b/Makefile @@ -112,7 +112,8 @@ endif -include $(SUBDIR_DEVICES_MAK_DEP) %/config-devices.mak: default-configs/%.mak - $(call quiet-command,$(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $@.tmp $<, " GEN $@.tmp") + $(call quiet-command, \ + $(SHELL) $(SRC_PATH)/scripts/make_device_config.sh $< $*-config-devices.mak.d $@ > $@.tmp, " GEN $@.tmp") $(call quiet-command, if test -f $@; then \ if cmp -s $@.old $@; then \ mv $@.tmp $@; \ diff --git a/scripts/make_device_config.sh b/scripts/make_device_config.sh index 7958086..c1afb3f 100644 --- a/scripts/make_device_config.sh +++ b/scripts/make_device_config.sh @@ -1,10 +1,12 @@ #! /bin/sh -# Construct a target device config file from a default, pulling in any -# files from include directives. +# Writes a target device config file to stdout, from a default and from +# include directives therein. Also emits Makefile dependencies. +# +# Usage: make_device_config.sh SRC DEPFILE-NAME DEPFILE-TARGET > DEST -dest=$1 -dep=`dirname $1`-`basename $1`.d -src=$2 +src=$1 +dep=$2 +target=$3 src_dir=`dirname $src` all_includes= @@ -22,7 +24,7 @@ while [ -n "$f" ] ; do [ $? = 0 ] || exit 1 all_includes="$all_includes $f" done -process_includes $src > $dest +process_includes $src -cat $src $all_includes | grep -v '^include' > $dest -echo "$1: $all_includes" > $dep +cat $src $all_includes | grep -v '^include' +echo "$target: $all_includes" > $dep