|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v2] rules.mak: Rewrite unnest-vars |
Date: | Fri, 23 May 2014 15:56:59 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Il 23/05/2014 15:33, Fam Zheng ha scritto:
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!
Since you'll send v2, please indent with 4 spaces too! Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |