aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2024-11-03 03:27:07 +0100
committerUlrich Müller <ulm@gentoo.org>2024-11-03 03:27:07 +0100
commit9e945e68383fc3d338830239fd7339a24635c389 (patch)
treece360b7b112c6fda68e6eedbee19019fc4c2e3f4
parentdevbook.xsl: Suppress permalinks in offline mode (diff)
downloaddevmanual-9e945e68383fc3d338830239fd7339a24635c389.tar.gz
devmanual-9e945e68383fc3d338830239fd7339a24635c389.tar.bz2
devmanual-9e945e68383fc3d338830239fd7339a24635c389.zip
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 <ulm@gentoo.org>
-rw-r--r--Makefile11
1 files 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: