From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: anthony@codemonkey.ws
Subject: [Qemu-devel] [PATCH v3 02/29] build: do not sprinkle around GENERATED_HEADERS dependencies
Date: Thu, 7 Jun 2012 09:39:47 +0200 [thread overview]
Message-ID: <1339054814-20939-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1339054814-20939-1-git-send-email-pbonzini@redhat.com>
Keeping GENERATED_HEADERS dependencies up-to-date everywhere is complex.
We can simply make the Makefile depend on them, and they will be built
before all other targets.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 18 +++++++++---------
Makefile.target | 14 ++++----------
tests/Makefile | 1 -
3 files changed, 13 insertions(+), 20 deletions(-)
diff --git a/Makefile b/Makefile
index 9b7a85e..c0ab97a 100644
--- a/Makefile
+++ b/Makefile
@@ -91,19 +91,18 @@ qemu-options.def: $(SRC_PATH)/qemu-options.hx
SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS))
-subdir-%: $(GENERATED_HEADERS)
+subdir-%:
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" all,)
ifneq ($(wildcard config-host.mak),)
include $(SRC_PATH)/Makefile.objs
endif
-$(universal-obj-y) $(common-obj-y): $(GENERATED_HEADERS)
subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o
$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) subdir-libdis
-$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
+$(filter %-user,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser
ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS))
romsubdir-%:
@@ -142,7 +141,7 @@ libcacard.la:
install-libcacard:
@echo "libtool is missing, please install and rerun configure"; exit 1
else
-libcacard.la: $(GENERATED_HEADERS) $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
+libcacard.la: $(oslib-obj-y) qemu-timer-common.o $(addsuffix .lo, $(basename $(trace-obj-y)))
$(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C libcacard V="$(V)" TARGET_DIR="$*/" libcacard.la,)
install-libcacard: libcacard.la
@@ -151,7 +150,6 @@ endif
######################################################################
qemu-img.o: qemu-img-cmds.h
-qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o cmd.o qemu-ga.o: $(GENERATED_HEADERS)
tools-obj-y = $(oslib-obj-y) $(trace-obj-y) qemu-tool.o qemu-timer.o \
qemu-timer-common.o main-loop.o notify.o iohandler.o cutils.o async.o
@@ -162,7 +160,6 @@ qemu-nbd$(EXESUF): qemu-nbd.o $(tools-obj-y) $(block-obj-y)
qemu-io$(EXESUF): qemu-io.o cmd.o $(tools-obj-y) $(block-obj-y)
qemu-bridge-helper$(EXESUF): qemu-bridge-helper.o
-qemu-bridge-helper.o: $(GENERATED_HEADERS)
fsdev/virtfs-proxy-helper$(EXESUF): fsdev/virtfs-proxy-helper.o fsdev/virtio-9p-marshal.o oslib-posix.o $(trace-obj-y)
fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
@@ -170,7 +167,6 @@ fsdev/virtfs-proxy-helper$(EXESUF): LIBS += -lcap
qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@," GEN $@")
-$(qapi-obj-y): $(GENERATED_HEADERS)
qapi-dir := $(BUILD_DIR)/qapi-generated
qemu-ga$(EXESUF): LIBS = $(LIBS_QGA)
qemu-ga$(EXESUF): QEMU_CFLAGS += -I $(qapi-dir)
@@ -203,8 +199,8 @@ $(SRC_PATH)/qapi-schema.json $(SRC_PATH)/scripts/qapi-commands.py
QGALIB_OBJ=$(addprefix $(qapi-dir)/, qga-qapi-types.o qga-qapi-visit.o qga-qmp-marshal.o)
QGALIB_GEN=$(addprefix $(qapi-dir)/, qga-qapi-types.h qga-qapi-visit.h qga-qmp-commands.h)
-$(QGALIB_OBJ): $(QGALIB_GEN) $(GENERATED_HEADERS)
-$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN) $(GENERATED_HEADERS)
+$(QGALIB_OBJ): $(QGALIB_GEN)
+$(qga-obj-y) qemu-ga.o: $(QGALIB_GEN)
qemu-ga$(EXESUF): qemu-ga.o $(qga-obj-y) $(tools-obj-y) $(qapi-obj-y) $(qobject-obj-y) $(version-obj-y) $(QGALIB_OBJ)
@@ -399,5 +395,9 @@ tar:
cd /tmp && tar zcvf ~/$(FILE).tar.gz $(FILE) --exclude CVS --exclude .git --exclude .svn
rm -rf /tmp/$(FILE)
+# Add a dependency on the generated files, so that they are always
+# rebuilt before other object files
+Makefile: $(GENERATED_HEADERS)
+
# Include automatically generated dependency files
-include $(wildcard *.d audio/*.d slirp/*.d block/*.d net/*.d ui/*.d qapi/*.d qga/*.d)
diff --git a/Makefile.target b/Makefile.target
index c94abfd..40b774a 100644
--- a/Makefile.target
+++ b/Makefile.target
@@ -1,6 +1,5 @@
# -*- Mode: makefile -*-
-GENERATED_HEADERS = config-target.h
CONFIG_NO_PCI = $(if $(subst n,,$(CONFIG_PCI)),n,y)
CONFIG_NO_KVM = $(if $(subst n,,$(CONFIG_KVM)),n,y)
CONFIG_NO_XEN = $(if $(subst n,,$(CONFIG_XEN)),n,y)
@@ -105,8 +104,6 @@ libobj-$(CONFIG_TCI_DIS) += tci-dis.o
tci-dis.o: QEMU_CFLAGS += -I$(SRC_PATH)/tcg -I$(SRC_PATH)/tcg/tci
-$(libobj-y): $(GENERATED_HEADERS)
-
# HELPER_CFLAGS is used for all the legacy code compiled with static register
# variables
ifneq ($(TARGET_BASE_ARCH), sparc)
@@ -143,8 +140,6 @@ obj-arm-y += arm-semi.o
obj-m68k-y += m68k-sim.o m68k-semi.o
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
-
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
@@ -166,8 +161,6 @@ obj-y = main.o bsdload.o elfload.o mmap.o signal.o strace.o syscall.o \
obj-i386-y += ioport-user.o
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
-
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../libuser/, $(user-obj-y))
obj-y += $(addprefix ../libdis-user/, $(libdis-y))
@@ -392,9 +385,7 @@ obj-xtensa-y += core-fsf.o
main.o: QEMU_CFLAGS+=$(GPROF_CFLAGS)
-monitor.o: hmp-commands.h qmp-commands-old.h
-
-$(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS)
+GENERATED_HEADERS += hmp-commands.h qmp-commands-old.h
obj-y += $(addprefix ../, $(universal-obj-y))
obj-y += $(addprefix ../, $(common-obj-y))
@@ -457,5 +448,8 @@ ifdef CONFIG_TRACE_SYSTEMTAP
$(INSTALL_DATA) $(QEMU_PROG).stp "$(DESTDIR)$(qemu_datadir)/../systemtap/tapset"
endif
+GENERATED_HEADERS += config-target.h
+Makefile: $(GENERATED_HEADERS)
+
# Include automatically generated dependency files
-include $(wildcard *.d */*.d)
diff --git a/tests/Makefile b/tests/Makefile
index ab7f667..2e754c3 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -37,7 +37,6 @@ test-qapi-obj-y = $(qobject-obj-y) $(qapi-obj-y) $(tools-obj-y)
test-qapi-obj-y += tests/test-qapi-visit.o tests/test-qapi-types.o
test-qapi-obj-y += module.o
-$(test-obj-y): $(GENERATED_HEADERS)
$(test-obj-y): QEMU_INCLUDES += -Itests
tests/check-qint$(EXESUF): tests/check-qint.o qint.o $(tools-obj-y)
--
1.7.10.1
next prev parent reply other threads:[~2012-06-07 7:40 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-07 7:39 [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 01/29] build: remove trace-nested-y Paolo Bonzini
2012-06-07 7:39 ` Paolo Bonzini [this message]
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 03/29] build: add rules for nesting Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 04/29] build: move *-user/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 05/29] build: move obj-TARGET-y variables " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 06/29] build: move libobj-y variable " Paolo Bonzini
2012-06-07 21:10 ` Blue Swirl
2012-06-07 23:18 ` Paolo Bonzini
2012-06-08 8:03 ` Andreas Färber
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 07/29] dump: do not compile dump.o for user-mode emulation Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 08/29] dump: change cpu_get_note_size to return ssize_t Paolo Bonzini
2012-06-11 1:52 ` Wen Congyang
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 09/29] dump: remove dumping stuff from cpu-all.h Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 10/29] build: move other target-*/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 11/29] build: move rules for nesting to Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 12/29] build: adapt qom/Makefile and move it " Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 13/29] build: move block/ objects to nested Makefile.objs Paolo Bonzini
2012-06-07 7:39 ` [Qemu-devel] [PATCH v3 14/29] build: move net/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 15/29] build: move fsdev/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 16/29] build: move ui/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 17/29] build: move audio/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 18/29] build: move slirp/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 19/29] build: move qapi/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 20/29] build: move qga/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 21/29] build: move target-independent hw/ " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 22/29] build: convert libhw " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 23/29] build: move per-target hw/ objects " Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 24/29] build: move device tree to per-target Makefile.objs Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 25/29] build: libcacard Makefile cleanups Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 26/29] build: limit usage of vpath Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 27/29] build: compile oslib-obj-y once Paolo Bonzini
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 28/29] configure: ensure directory exists when creating symlink Paolo Bonzini
2012-06-12 18:44 ` Andreas Färber
2012-06-07 7:40 ` [Qemu-devel] [PATCH v3 29/29] build: do not create directories at configure time Paolo Bonzini
2012-06-07 12:31 ` [Qemu-devel] [PULL v3 00/29] per-directory Makefile.objs snippets, limit vpath (ab)use Andreas Färber
2012-06-07 12:47 ` Anthony Liguori
2012-06-07 14:14 ` Paolo Bonzini
2012-06-08 13:59 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1339054814-20939-3-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=anthony@codemonkey.ws \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).