[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] rules.mak: Rewrite unnest-vars
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [PATCH v2] rules.mak: Rewrite unnest-vars |
Date: |
Fri, 23 May 2014 21:33:28 +0800 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Fri, 05/23 15:22, Paolo Bonzini wrote:
> Just one question:
>
> >+# fix-paths
> >+# Usage: $(call fix-paths, obj_path, src_path, vars)
> >+# Add prefix @obj_path to all objects in @vars, and add prefix @src_path to
> >all
> >+# directories in @vars.
> >+define fix-paths
> >+ $(foreach v,$3,
> >+ $(foreach o,$($v),
> >+ $(if $($o-libs),
> >+ $(eval $1$o-libs := $(value $o-libs)))
> >+ $(if $($o-cflags),
> >+ $(eval $1$o-cflags := $(value $o-cflags)))
> >+ $(if $($o-objs),
> >+ $(eval $1$o-objs := $(addprefix $1,$(value $o-objs)))))
> >+ $(eval $v := $(addprefix $1,$(filter-out %/,$(value $v))) \
> >+ $(addprefix $2,$(filter %/,$(value $v)))))
>
> Why $(value $v) here in? I think you need to expand the variable,
> especially in the last assignment but possibly also in the others. For
> example if you have
>
> OBJECTS = foo1.o foo2.o
> foo.mo-objs = $(OBJECTS)
>
> the addprefix would set
>
> foo.mo-objs = dir/$(OBJECTS)
>
> which is wrong.
Good catch! I'll fix this.
Thanks for reviewing!
Fam