From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiQ3t-00049G-Qm for qemu-devel@nongnu.org; Thu, 08 May 2014 11:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WiQ3m-00031S-68 for qemu-devel@nongnu.org; Thu, 08 May 2014 11:16:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50141) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WiQ3l-00031L-TW for qemu-devel@nongnu.org; Thu, 08 May 2014 11:16:34 -0400 Message-ID: <536B973E.80202@redhat.com> Date: Thu, 08 May 2014 16:39:58 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1399554527-22262-1-git-send-email-pbonzini@redhat.com> <1399554527-22262-2-git-send-email-pbonzini@redhat.com> <20140508134050.GA4827@T430.nay.redhat.com> In-Reply-To: <20140508134050.GA4827@T430.nay.redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] build: simplify and fix fix-obj-vars List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: mjt@tls.msk.ru, qemu-devel@nongnu.org Il 08/05/2014 15:40, Fam Zheng ha scritto: >> > define fix-obj-vars >> > -$(foreach v,$($1), \ >> > +$(if $2, >> > + $(foreach v,$($1), \ > Not very consistent in indentation. BTW what's the right space/tab style to > use in Makefiles for multi-line macros like this? No idea... I'll just join the two lines. >> > $(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 +193,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 +229,7 @@ endef >> > define unnest-vars >> > $(eval obj := $1) >> > $(eval nested-vars := $2) >> > -$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(if $(obj),$(obj)/))) > I'm not sure about this removed line since it's not in master, maybe you missed > a patch to squash? It's the original fix-obj-vars fix. Paolo >> > +$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(obj)))