[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars |
Date: |
Tue, 10 Jun 2014 12:40:11 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
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
>
- [Qemu-devel] [PULL 0/8] build system and libcacard changes for 2014-06-10, Paolo Bonzini, 2014/06/10
- [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
- [Qemu-devel] [PULL 4/8] libcacard: actually use symbols file, Paolo Bonzini, 2014/06/10
- [Qemu-devel] [PULL 5/8] libcacard: improve documentation, Paolo Bonzini, 2014/06/10
- [Qemu-devel] [PULL 2/8] vscclient: use glib thread primitives not qemu, Paolo Bonzini, 2014/06/10
- [Qemu-devel] [PULL 3/8] libcacard: replace qemu thread primitives with glib ones, Paolo Bonzini, 2014/06/10
- [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars, Paolo Bonzini, 2014/06/10
- Re: [Qemu-devel] [PULL 6/8] rules.mak: Rewrite unnest-vars,
Paolo Bonzini <=
- [Qemu-devel] [PULL 8/8] configure: unset interfering variables, Paolo Bonzini, 2014/06/10
- [Qemu-devel] [PULL 7/8] configure: duplicate/incorrect order of -lrt, Paolo Bonzini, 2014/06/10
- Re: [Qemu-devel] [PULL 0/8] build system and libcacard changes for 2014-06-10, Peter Maydell, 2014/06/10