From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Fam Zheng <famz@redhat.com>
Subject: Re: [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars
Date: Tue, 10 Jun 2014 12:40:11 +0200 [thread overview]
Message-ID: <5396E08B.8000203@redhat.com> (raw)
In-Reply-To: <1402379781-844-7-git-send-email-pbonzini@redhat.com>
Il 10/06/2014 07:56, Paolo Bonzini ha scritto:
> + $(foreach v,$(filter %-m,$2),
> + # All .o found in *-m variables are single object modules, create .mo
> + # for them
> + $(foreach o,$(filter %.o,$($v)),
> + $(eval $(o:%.o=%.mo)-objs := $o))
> + # Now unify .o in -m variable to .mo
> + $(eval $v := $($v:%.o=%.mo))
> +
> + $(eval modules: $($v:%.mo=%$(DSOSUF)))
> + $(eval modules-m += $($v))
> +
> + # For non-module build, add -m to -y
> + $(if $(CONFIG_MODULES),,$(eval $(patsubst %-m,%-y,$v) += $($v))))
Peter spotted a few problems here. This needs to be
+ $(if $(CONFIG_MODULES),
+ $(eval modules: $($v:%.mo=%$(DSOSUF)))
+ $(eval $(patsubst %-m,%-y,$v) += $(call expand-objs, $($v)))))
There are two changes:
1) You must not build modules if they are disabled
2) Because the .mo file has no dependencies, you need expand-objs. (In
fact we should just stop using .mo files except as an artificial construct
in Makefile.objs).
> +
> + # Post-process all the unnested vars
> + $(foreach v,$2,
> + $(foreach o, $(filter %.mo,$($v)),
> + # Find all the .mo objects in variables and add dependency rules
> + # according to .mo-objs. Report error if not set
> + $(if $($o-objs),
> + $(eval $(o:%.mo=%$(DSOSUF)): $($o-objs)),
> + $(error $o added in $v but $o-objs is not set))
> + # Pass the .mo-cflags along to member objects
> + $(if $($o-cflags),
> + $(foreach p,$($o-objs),
> + $(eval $p-cflags := $($o-cflags)))))
Finally, this should be a +=.
I'll send an updated pull request.
Paolo
> + $(shell mkdir -p ./ $(sort $(dir $($v))))
> + # Include all the .d files
> + $(eval -include $(addsuffix *.d, $(sort $(dir $($v)))))
> + $(eval $v := $(filter-out %/,$($v))))
> endef
>
next prev parent reply other threads:[~2014-06-10 10:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-10 5:56 [Qemu-devel] [PULL 0/8] build system and libcacard changes for 2014-06-10 Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 1/8] glib-compat.h: add new thread API emulation on top of pre-2.31 API Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 2/8] vscclient: use glib thread primitives not qemu Paolo Bonzini
2014-06-17 17:10 ` Ed Maste
2014-06-17 17:15 ` Paolo Bonzini
2014-06-17 19:11 ` Ed Maste
2014-06-18 9:25 ` Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 3/8] libcacard: replace qemu thread primitives with glib ones Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 4/8] libcacard: actually use symbols file Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 5/8] libcacard: improve documentation Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars Paolo Bonzini
2014-06-10 10:40 ` Paolo Bonzini [this message]
2014-06-10 5:56 ` [Qemu-devel] [PULL 7/8] configure: duplicate/incorrect order of -lrt Paolo Bonzini
2014-06-10 5:56 ` [Qemu-devel] [PULL 8/8] configure: unset interfering variables Paolo Bonzini
2014-06-10 10:00 ` [Qemu-devel] [PULL 0/8] build system and libcacard changes for 2014-06-10 Peter Maydell
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=5396E08B.8000203@redhat.com \
--to=pbonzini@redhat.com \
--cc=famz@redhat.com \
--cc=qemu-devel@nongnu.org \
/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).