From patchwork Tue Aug 4 16:21:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kaplansky X-Patchwork-Id: 503723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 06D7E1402D4 for ; Wed, 5 Aug 2015 03:01:45 +1000 (AEST) Received: from localhost ([::1]:36461 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMfat-0008BD-SK for incoming@patchwork.ozlabs.org; Tue, 04 Aug 2015 13:01:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43038) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMf7G-0007q7-PC for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:31:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMf7C-0006h6-4o for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:31:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38408) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMf7B-0006gz-WF for qemu-devel@nongnu.org; Tue, 04 Aug 2015 12:30:58 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 49E3A67; Tue, 4 Aug 2015 16:21:29 +0000 (UTC) Received: from redhat.com (dhcp-4-97.tlv.redhat.com [10.35.4.97]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t74GLQPZ010063; Tue, 4 Aug 2015 12:21:27 -0400 Date: Tue, 4 Aug 2015 19:21:25 +0300 From: Victor Kaplansky To: qemu-devel@nongnu.org Message-ID: <1438705028-10866-1-git-send-email-victork@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Tue, 04 Aug 2015 13:00:27 -0400 Cc: Paolo Bonzini , "Michael S. Tsirkin" , Eduardo Habkost , Richard Henderson Subject: [Qemu-devel] [PATCH] make: explicit dependencies for ACPI gen sources 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 Rebuilding QEMU after switching versions from git can cause make failure if IASL is enabled. This is caused by including stale *.d info from previous build. To prevent this in the future we generate dependency info for generated ACPI sources in *.dep instead regular *.d and include them explicitly. This will allow us not to break future builds when one of such generated sources is removed - by removing explicit include of removed dependency. By itself this doesn't fix broken builds from the past and this will be done by the following patch. Signed-off-by: Victor Kaplansky --- hw/i386/Makefile.objs | 4 +++- rules.mak | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/i386/Makefile.objs b/hw/i386/Makefile.objs index bd4f147..bcc7083 100644 --- a/hw/i386/Makefile.objs +++ b/hw/i386/Makefile.objs @@ -10,13 +10,15 @@ obj-y += acpi-build.o hw/i386/acpi-build.o: hw/i386/acpi-build.c \ hw/i386/acpi-dsdt.hex hw/i386/q35-acpi-dsdt.hex +-include hw/i386/acpi-dsdt.dep hw/i386/q35-acpi-dsdt.dep + iasl-option=$(shell if test -z "`$(1) $(2) 2>&1 > /dev/null`" \ ; then echo "$(2)"; else echo "$(3)"; fi ;) ifdef IASL #IASL Present. Generate hex files from .dsl hw/i386/%.hex: $(SRC_PATH)/hw/i386/%.dsl $(SRC_PATH)/scripts/acpi_extract_preprocess.py $(SRC_PATH)/scripts/acpi_extract.py - $(call quiet-command, $(CPP) -x c -P $(QEMU_DGFLAGS) $(QEMU_INCLUDES) $< -o $*.dsl.i.orig, " CPP $(TARGET_DIR)$*.dsl.i.orig") + $(call quiet-command, $(CPP) -x c -P $(QEMU_DGFLAGS_GEN) $(QEMU_INCLUDES) $< -o $*.dsl.i.orig, " CPP $(TARGET_DIR)$*.dsl.i.orig") $(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract_preprocess.py $*.dsl.i.orig > $*.dsl.i, " ACPI_PREPROCESS $(TARGET_DIR)$*.dsl.i") $(call quiet-command, $(IASL) $(call iasl-option,$(IASL),-Pn,) -vs -l -tc -p $* $*.dsl.i $(if $(V), , > /dev/null) 2>&1 ," IASL $(TARGET_DIR)$*.dsl.i") $(call quiet-command, $(PYTHON) $(SRC_PATH)/scripts/acpi_extract.py $*.lst > $*.off, " ACPI_EXTRACT $(TARGET_DIR)$*.off") diff --git a/rules.mak b/rules.mak index aec27f8..6019a46 100644 --- a/rules.mak +++ b/rules.mak @@ -18,6 +18,7 @@ QEMU_CXXFLAGS = -D__STDC_LIMIT_MACROS $(filter-out -Wstrict-prototypes -Wmissing # Flags for dependency generation QEMU_DGFLAGS += -MMD -MP -MT $@ -MF $(*D)/$(*F).d +QEMU_DGFLAGS_GEN += -MMD -MP -MT $@ -MF $(*D)/$(*F).dep # Same as -I$(SRC_PATH) -I., but for the nested source/object directories QEMU_INCLUDES += -I$(