From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5861A138350 for ; Mon, 2 Mar 2020 10:23:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6DE08E092F; Mon, 2 Mar 2020 10:23:54 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 27EA5E092F for ; Mon, 2 Mar 2020 10:23:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C992034F33F for ; Mon, 2 Mar 2020 10:23:52 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CB161157 for ; Mon, 2 Mar 2020 10:23:50 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1583098846.9b663cce9ed88ec5b86cfde8d050017d23894798.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: / X-VCS-Repository: proj/devmanual X-VCS-Files: .gitignore Makefile depend.xsl X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 9b663cce9ed88ec5b86cfde8d050017d23894798 X-VCS-Branch: master Date: Mon, 2 Mar 2020 10:23:50 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bafbff6f-e2ca-4fd5-ad88-bed6e92f3028 X-Archives-Hash: 38793605f77cfdf7e63dfce4ccadc4c0 commit: 9b663cce9ed88ec5b86cfde8d050017d23894798 Author: Ulrich Müller gentoo org> AuthorDate: Wed Feb 26 20:21:54 2020 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Mar 1 21:40:46 2020 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=9b663cce Makefile, depend.xsl: Use XSLT to generate the list of dependencies. Each HTML file must depend on its XML file with all its descendants (for the contents tree), all its ancestors (for breadcrumbs), and the previous and next documents (for backward and forward links). Trying to generate the list of dependencies with make seems hopeless (especially, how would one determine the previous and next documents?). OTOH, the necessary templates already exist in devbook.xsl. Therefore, add a simple depend.xsl on top of it, which outputs a dependency list as plain text. Closes: https://bugs.gentoo.org/710918 Signed-off-by: Ulrich Müller gentoo.org> .gitignore | 1 + Makefile | 21 +++++++++++++-------- depend.xsl | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ce644c7..7c45b92 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.html *.png +.depend documents.js eclass-reference/ diff --git a/Makefile b/Makefile index 4879792..be1224f 100644 --- a/Makefile +++ b/Makefile @@ -47,20 +47,23 @@ documents.js: bin/build_search_documents.py $(XMLS) rsvg-convert --output=$@ $< # Secondary expansion allows us to use the automatic variable $@ in -# the prerequisites. When it is used (and we have no idea when that -# is, so we assume always) our tag induces a -# dependency on the output of all subdirectories of the current -# directories. This wacky rule finds all of those subdirectories by -# looking for text.xml in them, and then replaces "text.xml" in the -# path with "index.html". +# the prerequisites. # # We use the pattern %.html rather than the more-sensible %index.html # because the latter doesn't match our top-level index.html target. # .SECONDEXPANSION: -%.html: $$(dir $$@)text.xml devbook.xsl xsl/*.xsl $$(subst text.xml,index.html,$$(wildcard $$(dir $$@)*/text.xml)) +%.html: $$(dir $$@)text.xml devbook.xsl xsl/*.xsl xsltproc --param offline "$(OFFLINE)" devbook.xsl $< > $@ +# Each HTML file must depend on its XML file with all its descendants +# (for the contents tree), all its ancestors (for breadcrumbs), and +# the previous and next documents (for backward and forward links). +# Generate the list of dependencies with XSLT, which appears to be a +# better tool for this than make. +.depend: $(XMLS) depend.xsl devbook.xsl + @xsltproc depend.xsl $(XMLS) | sed ':x;s%[^ /]*/\.\./%%;tx' > $@ + install: all set -e; \ for file in $(HTMLS) $(ECLASS_HTMLS) $(IMAGES); do \ @@ -89,6 +92,8 @@ tidy: $(HTMLS) $(ECLASS_HTMLS) exit $${status} clean: - @rm -f $(HTMLS) $(IMAGES) documents.js + @rm -f $(HTMLS) $(IMAGES) documents.js .depend .PHONY: all prereq build install validate tidy clean + +-include .depend diff --git a/depend.xsl b/depend.xsl new file mode 100644 index 0000000..e0ee66c --- /dev/null +++ b/depend.xsl @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +