From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34855) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wirxq-0006bJ-O1 for qemu-devel@nongnu.org; Fri, 09 May 2014 17:04:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wirxh-0005eS-Jc for qemu-devel@nongnu.org; Fri, 09 May 2014 17:04:18 -0400 Received: from mail-ee0-x22a.google.com ([2a00:1450:4013:c00::22a]:36430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wirxh-0005eA-Bq for qemu-devel@nongnu.org; Fri, 09 May 2014 17:04:09 -0400 Received: by mail-ee0-f42.google.com with SMTP id d49so3011789eek.1 for ; Fri, 09 May 2014 14:04:08 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 9 May 2014 23:03:43 +0200 Message-Id: <1399669424-29676-10-git-send-email-pbonzini@redhat.com> In-Reply-To: <1399669424-29676-1-git-send-email-pbonzini@redhat.com> References: <1399669424-29676-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PULL 09/10] build: simplify and fix fix-obj-vars List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mjt@tls.msk.ru fix-obj-vars has the undesired side effect of breaking -cflags -objs and -libs variables in the toplevel Makefile.objs. The variables in the toplevel Makefile.objs do not need any fix, so fix-obj-vars need not do anything. Since we are touching it, remove the now unnecessary $(if) in the callers. Signed-off-by: Paolo Bonzini --- rules.mak | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/rules.mak b/rules.mak index 73efafe..b12d312 100644 --- a/rules.mak +++ b/rules.mak @@ -175,16 +175,16 @@ $(eval save-$2-$1 :=) endef define fix-obj-vars -$(foreach v,$($1), \ +$(if $2, $(foreach v,$($1), \ $(if $($v-cflags), \ - $(eval $2$v-cflags := $($v-cflags)) \ + $(eval $2/$v-cflags := $($v-cflags)) \ $(eval $v-cflags := )) \ $(if $($v-libs), \ - $(eval $2$v-libs := $($v-libs)) \ + $(eval $2/$v-libs := $($v-libs)) \ $(eval $v-libs := )) \ $(if $($v-objs), \ - $(eval $2$v-objs := $(addprefix $2,$($v-objs))) \ - $(eval $v-objs := ))) + $(eval $2/$v-objs := $(addprefix $2/,$($v-objs))) \ + $(eval $v-objs := )))) endef define unnest-dir @@ -192,7 +192,7 @@ $(foreach var,$(nested-vars),$(call push-var,$(var),$1/)) $(eval obj-parent-$1 := $(obj)) $(eval obj := $(if $(obj),$(obj)/$1,$1)) $(eval include $(SRC_PATH)/$1/Makefile.objs) -$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(if $(obj),$(obj)/))) +$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(obj))) $(eval obj := $(obj-parent-$1)) $(eval obj-parent-$1 := ) $(foreach var,$(nested-vars),$(call pop-var,$(var),$1/)) @@ -228,7 +228,7 @@ endef define unnest-vars $(eval obj := $1) $(eval nested-vars := $2) -$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(if $(obj),$(obj)/))) +$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(obj))) $(eval old-nested-dirs := ) $(call unnest-vars-1) $(if $1,$(foreach v,$(nested-vars),$(eval \ -- 1.8.3.1