From patchwork Wed Jun 6 06:36:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 163277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 84B39B6F9A for ; Wed, 6 Jun 2012 17:26:53 +1000 (EST) Received: from localhost ([::1]:55606 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ScAdn-000496-D3 for incoming@patchwork.ozlabs.org; Wed, 06 Jun 2012 03:26:51 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc9rR-0003qq-Iv for qemu-devel@nongnu.org; Wed, 06 Jun 2012 02:36:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sc9rK-00029a-6N for qemu-devel@nongnu.org; Wed, 06 Jun 2012 02:36:53 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:50333) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sc9rJ-000290-QG for qemu-devel@nongnu.org; Wed, 06 Jun 2012 02:36:46 -0400 Received: by pbbro12 with SMTP id ro12so9244268pbb.4 for ; Tue, 05 Jun 2012 23:36:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=JCGdUNfgJizQjTfnhCWRCX6eBtZ9qqLkY6uMTbdbk24=; b=HItrjyNyZguzt2qJ0usx3gmbUJpH8sSX73LY5//s9b5JmjEnl35MYfRfbn18OPx3Zg DgDwRA2e32wqHzc0cPVJ1xhHqi7kAHr6XgTO0pAXgKQ+IRwmDoUX5B193CQ21oV5koJT 5MrVxj5rATLNpH7CfGd3mqbD/QU883fUIaa5rXT0u7DNvd8SlxQWxQElAq7IwmCN5/rz JES/iVRlwhjZW9kJt9vVpPowyyPWlYi3qOAYNMDOdejAwjbpLvyOnBc+8ipQj1XATzlW H+fGbbpHGmsB8Q5GQUsRdj2O0r7cCRxRNE5EWm6FRuxXZqDL4qiGZi1/A+mqcmChG5FD s5lw== Received: by 10.68.212.102 with SMTP id nj6mr45591118pbc.15.1338964603606; Tue, 05 Jun 2012 23:36:43 -0700 (PDT) Received: from yakj.usersys.redhat.com.usersys.redhat.com (p40081-ipngn402hodogaya.kanagawa.ocn.ne.jp. [180.23.161.81]) by mx.google.com with ESMTPS id py5sm1479093pbb.1.2012.06.05.23.36.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 23:36:42 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Wed, 6 Jun 2012 08:36:09 +0200 Message-Id: <1338964592-22223-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1338964592-22223-1-git-send-email-pbonzini@redhat.com> References: <1338964592-22223-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.45 Cc: anthony@codemonkey.ws Subject: [Qemu-devel] [PATCH v2 02/25] build: do not sprinkle around GENERATED_HEADERS dependencies X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 --- 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 1582904..95a82be 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)) @@ -389,9 +382,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)) @@ -452,5 +443,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)