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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 2C62E158042 for ; Tue, 5 Nov 2024 22:13:11 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 582F1E07F0; Tue, 5 Nov 2024 22:13:10 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3B807E07F0 for ; Tue, 5 Nov 2024 22:13:10 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4547B340B57 for ; Tue, 5 Nov 2024 22:13:09 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 85F3517E0 for ; Tue, 5 Nov 2024 22:13:07 +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: <1730600827.9e945e68383fc3d338830239fd7339a24635c389.ulm@gentoo> Subject: [gentoo-commits] proj/devmanual:master commit in: / X-VCS-Repository: proj/devmanual X-VCS-Files: Makefile X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 9e945e68383fc3d338830239fd7339a24635c389 X-VCS-Branch: master Date: Tue, 5 Nov 2024 22:13:07 +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: c9ca817e-b8e1-4684-8891-a806d3d9d557 X-Archives-Hash: 79b5af8a5dbf89da81e48a2c24ac3efd commit: 9e945e68383fc3d338830239fd7339a24635c389 Author: Ulrich Müller gentoo org> AuthorDate: Sun Nov 3 02:27:07 2024 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Nov 3 02:27:07 2024 +0000 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=9e945e68 Makefile: Secondary expansion is not needed Drop .SECONDEXPANSION and use a static pattern rule instead. The problem addressed by secondary expansion was that % in a "normal" pattern rule doesn't match the empty string, therefore %index.html won't match the top-level index.html target. By contract, % in a static pattern rule matches any part of the target name. Using a pattern rule like "ind%x.html: t%xt.xml ..." would also be possible but seems a little hackish. Signed-off-by: Ulrich Müller gentoo.org> Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 042ffa7..c377d5d 100644 --- a/Makefile +++ b/Makefile @@ -50,14 +50,9 @@ documents.js: bin/build_search_documents.py $(XMLS) %.png : %.svg rsvg-convert --output=$@ $< -# Secondary expansion allows us to use the automatic variable $@ in -# 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 +# Use a static pattern rule, otherwise %index.html won't match the +# top-level index.html target. +$(HTMLS): %index.html: %text.xml devbook.xsl xsl/*.xsl xsltproc --param offline "$(OFFLINE)" devbook.xsl $< > $@ eclass-reference/text.xml: