提交 99100dc3 编写于 作者: P Paolo Bonzini

build: move rules for nesting to Makefile.objs

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: NPaolo Bonzini <pbonzini@redhat.com>
上级 fbe37ef3
...@@ -468,3 +468,5 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS) ...@@ -468,3 +468,5 @@ vl.o: QEMU_CFLAGS+=$(SDL_CFLAGS)
QEMU_CFLAGS+=$(GLIB_CFLAGS) QEMU_CFLAGS+=$(GLIB_CFLAGS)
nested-vars += # ...
dummy := $(call unnest-vars)
...@@ -21,8 +21,6 @@ QEMU_CFLAGS += -I../linux-headers ...@@ -21,8 +21,6 @@ QEMU_CFLAGS += -I../linux-headers
endif endif
QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H QEMU_CFLAGS += -I.. -I$(TARGET_PATH) -DNEED_CPU_H
include $(SRC_PATH)/Makefile.objs
QEMU_CFLAGS+=-I$(SRC_PATH)/include QEMU_CFLAGS+=-I$(SRC_PATH)/include
ifdef CONFIG_USER_ONLY ifdef CONFIG_USER_ONLY
...@@ -107,10 +105,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user ...@@ -107,10 +105,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/linux-user/$(TARGET_ABI_DIR) -I$(SRC_PATH)/linux-user
obj-y += linux-user/ obj-y += linux-user/
obj-y += gdbstub.o thunk.o user-exec.o $(oslib-obj-y) 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 endif #CONFIG_LINUX_USER
######################################################### #########################################################
...@@ -123,10 +117,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH) ...@@ -123,10 +117,6 @@ QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ARCH)
obj-y += bsd-user/ obj-y += bsd-user/
obj-y += gdbstub.o user-exec.o 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 endif #CONFIG_BSD_USER
######################################################### #########################################################
...@@ -191,33 +181,40 @@ main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS) ...@@ -191,33 +181,40 @@ main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h 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 endif # CONFIG_SOFTMMU
ifndef CONFIG_LINUX_USER nested-vars += obj-y
ifndef CONFIG_BSD_USER
# 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 # libcacard needs qemu-thread support, and besides is only needed by devices
# so not requires with linux-user / bsd-user targets # so not requires with linux-user / bsd-user targets
obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y)) all-obj-$(CONFIG_SMARTCARD_NSS) += $(addprefix ../libcacard/, $(libcacard-y))
endif # CONFIG_BSD_USER
endif # CONFIG_LINUX_USER
nested-vars = obj-y else
dummy := $(call unnest-vars) all-obj-y += $(addprefix ../libuser/, $(user-obj-y))
all-obj-y += $(addprefix ../libdis-user/, $(libdis-y))
endif #CONFIG_LINUX_USER
ifdef QEMU_PROGW ifdef QEMU_PROGW
# The linker builds a windows executable. Make also a console executable. # The linker builds a windows executable. Make also a console executable.
$(QEMU_PROGW): $(obj-y) $(QEMU_PROGW): $(all-obj-y)
$(call LINK,$^) $(call LINK,$^)
$(QEMU_PROG): $(QEMU_PROGW) $(QEMU_PROG): $(QEMU_PROGW)
$(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)") $(call quiet-command,$(OBJCOPY) --subsystem console $(QEMU_PROGW) $(QEMU_PROG)," GEN $(TARGET_DIR)$(QEMU_PROG)")
else else
$(QEMU_PROG): $(obj-y) $(QEMU_PROG): $(all-obj-y)
$(call LINK,$^) $(call LINK,$^)
endif endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册