On Tue, 04/29 08:29, Paolo Bonzini wrote: > Il 29/04/2014 05:29, Fam Zheng ha scritto: > > The compiling is done in a subdir, so the extraction of per-object libs > > and cflags are referencing objects with ../ prefixed. So prefix the > > per-object variables "foo.o-cflags" and "foo.o-libs" to > > "../foo.o-cflags" and "../foo.o-libs". > > > > Signed-off-by: Fam Zheng <f...@redhat.com> > > --- > > Makefile.target | 11 ++++++----- > > 1 file changed, 6 insertions(+), 5 deletions(-) > > > > diff --git a/Makefile.target b/Makefile.target > > index ba12340..3a30aad 100644 > > --- a/Makefile.target > > +++ b/Makefile.target > > @@ -146,11 +146,12 @@ obj-y-save := $(obj-y) > > block-obj-y := > > common-obj-y := > > include $(SRC_PATH)/Makefile.objs > > -dummy := $(call unnest-vars,.., \ > > - block-obj-y \ > > - block-obj-m \ > > - common-obj-y \ > > - common-obj-m) > > +vars := block-obj-y \ > > + block-obj-m \ > > + common-obj-y \ > > + common-obj-m > > +dummy := $(foreach v,$(vars),$(call fix-obj-vars,$v,../)) > > +dummy := $(call unnest-vars,.., $(vars)) > > > > # Now restore obj-y > > obj-y := $(obj-y-save) > > > > What about this instead, does it do the same?
Yes, it's better! Fam > > diff --git a/rules.mak b/rules.mak > index 5c454d8..7038576 100644 > --- a/rules.mak > +++ b/rules.mak > @@ -228,6 +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)/))) > $(eval old-nested-dirs := ) > $(call unnest-vars-1) > $(if $1,$(foreach v,$(nested-vars),$(eval \ > > Regarding Michael's objection, I do have a simplification patch > pending to use subdir-y instead of embedding directories in the > object variables. That does make things a bit simpler. > > Paolo >