[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] Makefile: Fix per-object variables for Makefile
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH] Makefile: Fix per-object variables for Makefile.target |
Date: |
Tue, 29 Apr 2014 08:29:41 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 |
Il 29/04/2014 05:29, Fam Zheng ha scritto:
> The compiling is done in a subdir, so the extraction of per-object libs
> and cflags are referencing objects with ../ prefixed. So prefix the
> per-object variables "foo.o-cflags" and "foo.o-libs" to
> "../foo.o-cflags" and "../foo.o-libs".
>
> Signed-off-by: Fam Zheng <address@hidden>
> ---
> Makefile.target | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/Makefile.target b/Makefile.target
> index ba12340..3a30aad 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -146,11 +146,12 @@ obj-y-save := $(obj-y)
> block-obj-y :=
> common-obj-y :=
> include $(SRC_PATH)/Makefile.objs
> -dummy := $(call unnest-vars,.., \
> - block-obj-y \
> - block-obj-m \
> - common-obj-y \
> - common-obj-m)
> +vars := block-obj-y \
> + block-obj-m \
> + common-obj-y \
> + common-obj-m
> +dummy := $(foreach v,$(vars),$(call fix-obj-vars,$v,../))
> +dummy := $(call unnest-vars,.., $(vars))
>
> # Now restore obj-y
> obj-y := $(obj-y-save)
>
What about this instead, does it do the same?
diff --git a/rules.mak b/rules.mak
index 5c454d8..7038576 100644
--- a/rules.mak
+++ b/rules.mak
@@ -228,6 +228,7 @@ endef
define unnest-vars
$(eval obj := $1)
$(eval nested-vars := $2)
+$(foreach v,$(nested-vars),$(call fix-obj-vars,$v,$(if $(obj),$(obj)/)))
$(eval old-nested-dirs := )
$(call unnest-vars-1)
$(if $1,$(foreach v,$(nested-vars),$(eval \
Regarding Michael's objection, I do have a simplification patch
pending to use subdir-y instead of embedding directories in the
object variables. That does make things a bit simpler.
Paolo