From patchwork Thu Sep 19 15:59:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 174069 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp1221308ill; Thu, 19 Sep 2019 09:16:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqyUHXr6mt3tTY1e40gZdP+L9ngxJXAlkKwG+V6CaZns/vAEh8yC7J/hewsPf8zyhDT3RPW4 X-Received: by 2002:ac8:6b09:: with SMTP id w9mr3985512qts.31.1568909805626; Thu, 19 Sep 2019 09:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568909805; cv=none; d=google.com; s=arc-20160816; b=Y54e10dSK5EYKPBqflcvcp1I8PfYTbQH4+UM6sJ3yRLCcTjSmIYrm8TRqV4MDqF2fp 6ov8UnJkefDYlo4/3QLaWlHKxYjDxqtcu00I0RDCnnXCSJyi302f+OSHVQlotpdMvU9X 9aJUSt66XxXTOULcn9vTNO7RQfeylYvnVB8BeOhn4204xi8OlN7hsU981XxzStHnrZuo bjPwBU2ECs2x4dCkjn4XEyOJe8bz774qxRypjvlX0AOFcxjBdO/FDgjyBXggeCIS9fs9 UP7djKhoJayVb2jRRxpmsrATiapO3FhqoyU6g6z7MShCgdWsFknchIUZ+gxPyvVkABr7 SGzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature; bh=mxbpLFgbvXahsfaVwZ9WqZ1fAPev+aEfkTXQWBTT2B0=; b=M+A1+CUZEVSdf537lIPo4tKj1uAUgr+twBdwIfHGtVepe/kfjvhGgFUEtVxiqL3oK7 RyLUo2+YltkNwjLJFROOyXASIEnHX83EpEupCJC4iMJZ089FpaUIdEQaefOO7vrY0sq9 wt4sdVrr/aDg+SkLFG2vocEXIoxfRBmO76R0NIVe0rcDV/rgbVMzfi6ZjKLkewqipWlr B6xBxgpYXcR5eeF2A0qVSSnsn3vMbe11oQ3JkunuxfsSriR27htVC6/6un3Lk0maNYSs p5zolsvYCx2m+2TwYJOzUZkWWQvpGeimPurhwtOpSpbXy9hqaoJeIi9wfWr5WejlrJA+ o1Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=do31j4xL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p48si6909197qvc.84.2019.09.19.09.16.45 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Sep 2019 09:16:45 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=do31j4xL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46126 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAz6q-0006Sa-GY for patch@linaro.org; Thu, 19 Sep 2019 12:16:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41326) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAz4e-00066q-E9 for qemu-devel@nongnu.org; Thu, 19 Sep 2019 12:14:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAyqg-0000Gd-DE for qemu-devel@nongnu.org; Thu, 19 Sep 2019 12:00:03 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]:51971) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iAyqg-0000FZ-4f for qemu-devel@nongnu.org; Thu, 19 Sep 2019 12:00:02 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 7so5242839wme.1 for ; Thu, 19 Sep 2019 09:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mxbpLFgbvXahsfaVwZ9WqZ1fAPev+aEfkTXQWBTT2B0=; b=do31j4xLBXcXlW/y83xkvfwl6HVbamfqvv4inkU34bFFphJSIBzFAO9gdNYxUWg1vx Sa9dfCdnNiTVOcLz1v6/tbhBy2fZUb9ABI7nIA30gu0DW7IBtAbVcci7IB/54IbXuJRO MYOstFPlnCgzqujG3mZ6EqOmXMPGuIMIp0njWD4ASzS9yD4/WQtq4Ps3t0r+IyBJdPT9 pjfcRZI1Sh38cJZXiJBv2UzuL9M153XcmWAOB3kcUsg45fkp24Z0CLwh2yC80qRkUVE+ kng8308mnHSP/2wgLP5k608e39XLT4vyraQihXmPvBEIz7tSGB8Ax5Ejl0Y95EdtcsjP EYnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mxbpLFgbvXahsfaVwZ9WqZ1fAPev+aEfkTXQWBTT2B0=; b=qDm2bmymwvhMWl8RavYDS04o4Jka2f/3IA0irhRhCg6oeICyQXo84kPktvAJJ8BdaM GI3Gvm8CVbRwOzIbj1n/MkiyKJDNW9Ck50r6Y8VQnADVGu9ExATxbyPanaCWuda839rt RvCGslAWa0osOPym8xJOlA8t4DeoHJoJlP39hQeXqd/VIfdP8RZHgo9/BpD6yT/tKE6a Qsy09vewhRE4JDBkblR1T9xwyaAOkpPKAb3AL3wBqNB9B1yC3ZzyR7eNobOlvyytVd4g kbq/nuZUE4oMPJWtWPYO7O/SC45QGK0FCVl7gP1Wx0zEdbdMIz+++wE9sCSqbNIkcDIh 26Og== X-Gm-Message-State: APjAAAWwDRp5nefY6RfsmWGKkyzyFFNftF5qCRPCdz3WU/x3KZgRGCh8 uGwhJ4Z3GHiwFU8KzBY/zQsgrsRY3oo3Ag== X-Received: by 2002:a1c:9615:: with SMTP id y21mr3494503wmd.5.1568908800022; Thu, 19 Sep 2019 09:00:00 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id r6sm6131493wmh.38.2019.09.19.08.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Sep 2019 08:59:59 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH] Makefile: Fix in-tree builds when Sphinx is available Date: Thu, 19 Sep 2019 16:59:57 +0100 Message-Id: <20190919155957.12618-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::32c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Alex_Benn=C3=A9e?= Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In commit 27a296fce9821e we switched the qemu-ga manpage over to being built from Sphinx. The makefile rules for this were correct for an out-of-tree build, but break for in-tree builds if Sphinx is present and we're trying to build the documentation. Specifically, because Sphinx refuses to build output files into the same directory as its sources, for an in-tree build we tell it to build into a subdirectory docs/built, and set up a makefile variable MANUAL_BUILDDIR indicating where the docs are going. The makefile rule telling Make how to build qemu-ga.8 correctly used this variable, but the lines adding qemu-ga.8 to the list of DOCS to be built and the 'make install' rune did not. The effect was that for an in-tree build we told Make to build 'docs/interop/qemu-ga.8' but did not provide a specific rule for doing so, which caused Make to fall back to the old rules.make rule for building any "%.8" file. Make tried to invoke texi2pod with a bogus command line, resulting in the error: GEN docs/interop/qemu-ga.8 No filename or title make: *** [rules.mak:394: docs/interop/qemu-ga.8] Fix this by using $(MANUAL_BUILDDIR) when constructing the list of DOCS files we want to build and also in the source file name we install for 'make install'. (Among other things, this broke the Shippable CI builds.) Reported-by: Eric Blake Signed-off-by: Peter Maydell --- Makefile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) -- 2.20.1 Tested-by: Alex Bennée Reviewed-by: Alex Bennée Tested-by: Eric Blake Reviewed-by: Eric Blake diff --git a/Makefile b/Makefile index 111082ce545..a0c1430b407 100644 --- a/Makefile +++ b/Makefile @@ -324,8 +324,19 @@ endif endif endif +# Sphinx does not allow building manuals into the same directory as +# the source files, so if we're doing an in-tree QEMU build we must +# build the manuals into a subdirectory (and then install them from +# there for 'make install'). For an out-of-tree build we can just +# use the docs/ subdirectory in the build tree as normal. +ifeq ($(realpath $(SRC_PATH)),$(realpath .)) +MANUAL_BUILDDIR := docs/built +else +MANUAL_BUILDDIR := docs +endif + ifdef BUILD_DOCS -DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 docs/interop/qemu-ga.8 +DOCS=qemu-doc.html qemu-doc.txt qemu.1 qemu-img.1 qemu-nbd.8 $(MANUAL_BUILDDIR)/interop/qemu-ga.8 DOCS+=docs/interop/qemu-qmp-ref.html docs/interop/qemu-qmp-ref.txt docs/interop/qemu-qmp-ref.7 DOCS+=docs/interop/qemu-ga-ref.html docs/interop/qemu-ga-ref.txt docs/interop/qemu-ga-ref.7 DOCS+=docs/qemu-block-drivers.7 @@ -699,17 +710,6 @@ dist: qemu-$(VERSION).tar.bz2 qemu-%.tar.bz2: $(SRC_PATH)/scripts/make-release "$(SRC_PATH)" "$(patsubst qemu-%.tar.bz2,%,$@)" -# Sphinx does not allow building manuals into the same directory as -# the source files, so if we're doing an in-tree QEMU build we must -# build the manuals into a subdirectory (and then install them from -# there for 'make install'). For an out-of-tree build we can just -# use the docs/ subdirectory in the build tree as normal. -ifeq ($(realpath $(SRC_PATH)),$(realpath .)) -MANUAL_BUILDDIR := docs/built -else -MANUAL_BUILDDIR := docs -endif - define clean-manual = rm -rf $(MANUAL_BUILDDIR)/$1/_static rm -f $(MANUAL_BUILDDIR)/$1/objects.inv $(MANUAL_BUILDDIR)/$1/searchindex.js $(MANUAL_BUILDDIR)/$1/*.html @@ -819,7 +819,7 @@ ifdef CONFIG_TRACE_SYSTEMTAP $(INSTALL_DATA) scripts/qemu-trace-stap.1 "$(DESTDIR)$(mandir)/man1" endif ifneq (,$(findstring qemu-ga,$(TOOLS))) - $(INSTALL_DATA) docs/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8" + $(INSTALL_DATA) $(MANUAL_BUILDDIR)/interop/qemu-ga.8 "$(DESTDIR)$(mandir)/man8" $(INSTALL_DATA) docs/interop/qemu-ga-ref.html "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) docs/interop/qemu-ga-ref.txt "$(DESTDIR)$(qemu_docdir)" $(INSTALL_DATA) docs/interop/qemu-ga-ref.7 "$(DESTDIR)$(mandir)/man7"