From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43981) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK15U-0007gP-0F for qemu-devel@nongnu.org; Thu, 12 Sep 2013 03:13:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VK15M-0002oC-Mq for qemu-devel@nongnu.org; Thu, 12 Sep 2013 03:13:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VK15M-0002o0-7c for qemu-devel@nongnu.org; Thu, 12 Sep 2013 03:13:04 -0400 Date: Thu, 12 Sep 2013 15:12:58 +0800 From: Fam Zheng Message-ID: <20130912071258.GA13797@T430s.nay.redhat.com> References: <1378906448-15834-1-git-send-email-famz@redhat.com> <1378906448-15834-3-git-send-email-famz@redhat.com> <52307375.2060403@redhat.com> <20130912025251.GJ9134@T430s.nay.redhat.com> <52316061.1040905@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52316061.1040905@redhat.com> Subject: Re: [Qemu-devel] [PATCH v6 2/8] rule.mak: allow per object cflags and libs Reply-To: famz@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: peter.maydell@linaro.org, mjt@tls.msk.ru, qemu-devel@nongnu.org, stefanha@redhat.com, vilanova@ac.upc.edu, rth@twiddle.net On Thu, 09/12 08:34, Paolo Bonzini wrote: > Il 12/09/2013 04:52, Fam Zheng ha scritto: > >>> > > define unnest-dir > >>> > > $(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)/))) > >>> > > $(eval obj := $(obj-parent-$1)) > >>> > > $(eval obj-parent-$1 := ) > >>> > > $(foreach var,$(nested-vars),$(call pop-var,$(var),$1/)) > >>> > > > >> > > >> > I'm not sure this will work for targets in the toplevel directory when > >> > obj-base is not empty. This can be fixed later though, as part of a > >> > general revamping of obj-base. Please add a FIXME comment. > >> > > > I'm not sure about the problem, can you give an example, so I can be specific > > in the comment? > > Can you try using vl.o-cflags instead of a per-target QEMU_CFLAGS? I > think it won't work, because the toplevel Makefile.objs is included > directly and not through unnest-dir. > I think this case works. Only in subdir %-cflags relies on unnest-vars to prefix them, toplevel objects don't need this: In toplevel Makefile.objs, vl.o-cflags = -DTEST_CFLAGS_FOR_VL_O Then, rm vl.o ; make vl.o V=1 | grep TEST_CFLAGS_FOR_VL_O cc -DTEST_CFLAGS_FOR_VL_O -c -o vl.o vl.c Fam