[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 08/25] build: move rules for nesting to Makefile.
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH v2 08/25] build: move rules for nesting to Makefile.objs |
Date: |
Wed, 6 Jun 2012 08:36:15 +0200 |
At this point we will start adding nesting behavior to other files
than Makefile.target. Because Makefile.objs is included by
Makefile.target, it is simpler to move the processing of
subdirectories there.
To enable this, only add per-target files to obj-y. Use a separate
variable for the linker dependencies, all-obj-y. This variable includes
obj-y and also all objects that are taken from other directories.
Signed-off-by: Paolo Bonzini <address@hidden>
---
Makefile.objs | 2 ++
Makefile.target | 47 ++++++++++++++++++++++-------------------------
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/Makefile.objs b/Makefile.objs
index 1daa92c..e06db12 100644
--- a/Makefile.objs
+++ b/Makefile.objs
@@ -468,3 +468,5 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS)
+nested-vars += # ...
+dummy := $(call unnest-vars)
diff --git a/Makefile.target b/Makefile.target
index 4714a30..006f1cd 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -19,8 +19,6 @@ QEMU_CFLAGS += -I../linux-headers
endif
QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
-include $(SRC_PATH)/Makefile.objs
-
QEMU_CFLAGS+=-I$(SRC_PATH)/include
ifdef CONFIG_USER_ONLY
@@ -105,10 +103,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR)
-I$(SRC_PATH)/linux-user
obj-y += linux-user/
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y)
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../libuser/, $(user-obj-y))
-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-
endif #CONFIG_LINUX_USER
#########################################################
@@ -121,10 +115,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user
-I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
obj-y += bsd-user/
obj-y += gdbstub.o user-exec.o
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../libuser/, $(user-obj-y))
-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
-
endif #CONFIG_BSD_USER
#########################################################
@@ -185,33 +175,40 @@ main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
-obj-y += $(addprefix ../, $(universal-obj-y))
-obj-y += $(addprefix ../, $(common-obj-y))
-obj-y += $(addprefix ../libdis/, $(libdis-y))
-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
-obj-y += $(addprefix ../, $(trace-obj-y))
-
endif # CONFIG_SOFTMMU
-ifndef CONFIG_LINUX_USER
-ifndef CONFIG_BSD_USER
+nested-vars += obj-y
+
+# This resolves all nested paths, so it must come last
+include $(SRC_PATH)/Makefile.objs
+
+all-obj-y = $(obj-y)
+all-obj-y += $(addprefix ../, $(universal-obj-y))
+
+ifdef CONFIG_SOFTMMU
+
+all-obj-y += $(addprefix ../, $(common-obj-y))
+all-obj-y += $(addprefix ../libdis/, $(libdis-y))
+all-obj-y += $(addprefix $(HWDIR)/, $(hw-obj-y))
+all-obj-y += $(addprefix ../, $(trace-obj-y))
+
# libcacard needs qemu-thread support, and besides is only needed by devices
# so not requires with linux-user / bsd-user targets
-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-endif # CONFIG_BSD_USER
-endif # CONFIG_LINUX_USER
+all-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
-nested-vars = obj-y
-dummy := $(call unnest-vars)
+else
+all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
+all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
+endif #CONFIG_LINUX_USER
ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable.
-$(QEMU_PROGW): $(obj-y)
+$(QEMU_PROGW): $(all-obj-y)
$(call LINK,$^)
$(QEMU_PROG): $(QEMU_PROGW)
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW)
$(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
else
-$(QEMU_PROG): $(obj-y)
+$(QEMU_PROG): $(all-obj-y)
$(call LINK,$^)
endif
--
1.7.10.1
- [Qemu-devel] [PATCH v2 00/25] per-directory Makefile.objs snippets, limit vpath (ab)use, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 01/25] build: remove trace-nested-y, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 23/25] build: limit usage of vpath, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 24/25] build: compile oslib-obj-y once, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 22/25] build: libcacard Makefile cleanups, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 25/25] build: do not create directories at configure time, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 09/25] build: put qom/ rules in a Makefile.objs file, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 21/25] build: move device tree to per-target Makefile, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 04/25] build: move *-user/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 19/25] build: convert libhw to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 08/25] build: move rules for nesting to Makefile.objs,
Paolo Bonzini <=
- [Qemu-devel] [PATCH v2 03/25] build: add rules for nesting, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 13/25] build: move ui/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 07/25] build: move other target-*/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 02/25] build: do not sprinkle around GENERATED_HEADERS dependencies, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 05/25] build: move obj-TARGET-y variables to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 12/25] build: move fsdev/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 20/25] build: move per-target hw/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 15/25] build: move slirp/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 18/25] build: move target-independent hw/ objects to nested Makefiles, Paolo Bonzini, 2012/06/06
- [Qemu-devel] [PATCH v2 17/25] build: move qga/ objects to nested Makefile.objs, Paolo Bonzini, 2012/06/06