From: Paolo Bonzini <pbonzini@redhat.com>
To: Fam Zheng <famz@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Richard Henderson <rth@twiddle.net>,
mjt@tls.msk.ru, qemu-devel@nongnu.org,
Micael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH v2] rules.mak: Rewrite unnest-vars
Date: Fri, 23 May 2014 15:56:59 +0200 [thread overview]
Message-ID: <537F53AB.1040202@redhat.com> (raw)
In-Reply-To: <20140523133328.GA12112@T430.nay.redhat.com>
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 parent reply other threads:[~2014-05-23 13:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-13 13:24 [Qemu-devel] [PATCH v2] rules.mak: Rewrite unnest-vars Fam Zheng
2014-05-23 2:37 ` Fam Zheng
2014-05-23 13:22 ` Paolo Bonzini
2014-05-23 13:33 ` Fam Zheng
2014-05-23 13:56 ` Paolo Bonzini [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=537F53AB.1040202@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=mjt@tls.msk.ru \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).