aboutsummaryrefslogtreecommitdiff
path: root/Makefile.target
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-02-10 14:48:52 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2014-02-20 13:12:54 +0100
commitba1183da9a10b94611cad88c44a5c6df005f9b55 (patch)
treed9be4600b1301c9c2d39ae78aded3a464dff361e /Makefile.target
parent10f5bff622cad71645e22c027b77ac31e51008ef (diff)
rules.mak: fix $(obj) to a real relative path
Makefile.target includes rule.mak and unnested common-obj-y, then prefix them with '../', this will ignore object specific QEMU_CFLAGS in subdir Makefile.objs: $(obj)/curl.o: QEMU_CFLAGS += $(CURL_CFLAGS) Because $(obj) here is './block', instead of '../block'. This doesn't hurt compiling because we basically build all .o from top Makefile, before entering Makefile.target, but it will affact arriving per-object libs support. The starting point of $(obj) is passed in as argument of unnest-vars, as well as nested variables, so that different Makefiles can pass in a right value. Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'Makefile.target')
-rw-r--r--Makefile.target17
1 files changed, 13 insertions, 4 deletions
diff --git a/Makefile.target b/Makefile.target
index af6ac7eaa1..9a6e7dd1b8 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -139,13 +139,22 @@ endif # CONFIG_SOFTMMU
# Workaround for http://gcc.gnu.org/PR55489, see configure.
%/translate.o: QEMU_CFLAGS += $(TRANSLATE_OPT_CFLAGS)
-nested-vars += obj-y
+dummy := $(call unnest-vars,,obj-y)
-# This resolves all nested paths, so it must come last
+# we are making another call to unnest-vars with different vars, protect obj-y,
+# it can be overriden in subdir Makefile.objs
+obj-y-save := $(obj-y)
+
+block-obj-y :=
+common-obj-y :=
include $(SRC_PATH)/Makefile.objs
+dummy := $(call unnest-vars,..,block-obj-y common-obj-y)
+
+# Now restore obj-y
+obj-y := $(obj-y-save)
-all-obj-y = $(obj-y)
-all-obj-y += $(addprefix ../, $(common-obj-y))
+all-obj-y = $(obj-y) $(common-obj-y)
+all-obj-$(CONFIG_SOFTMMU) += $(block-obj-y)
ifndef CONFIG_HAIKU
LIBS+=-lm