Skip to content

Commit 8af0699

Browse files
avargitster
authored andcommitted
Documentation/Makefile: fix "make info" regression in dad9cd7
Fix a regression in my dad9cd7 (Makefile: move ".SUFFIXES" rule to shared.mak, 2022-03-03). As explained in the GNU make documentation for the $* variable, available at: info make --index-search='$*' This rule relied on ".texi" being in the default list of suffixes, as seen at: make -f/dev/null -p | grep -v -e ^# -e ^$|grep -F .SUFFIXES The documentation explains what was going on here: In an explicit rule, there is no stem; so '$*' cannot be determined in that way. Instead, if the target name ends with a recognized suffix (*note Old-Fashioned Suffix Rules: Suffix Rules.), '$*' is set to the target name minus the suffix. For example, if the target name is 'foo.c', then '$*' is set to 'foo', since '.c' is a suffix. GNU 'make' does this bizarre thing only for compatibility with other implementations of 'make'. You should generally avoid using '$*' except in implicit rules or static pattern rules. If the target name in an explicit rule does not end with a recognized suffix, '$*' is set to the empty string for that rule. I.e. this rule added back in 5cefc33 (Documentation: add gitman.info target, 2007-12-10) was resolving gitman.texi from gitman.info. We can instead just use the more obvious $< variable referring to the prerequisite. This was the only use of $* in our Makefiles in an explicit rule, the three remaining ones are all implicit rules, and therefore didn't depend on the ".SUFFIXES" list. Reported-by: Adam Dinwoodie <[email protected]> Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Tested-by: Adam Dinwoodie <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 05b8b82 commit 8af0699

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ gitman.texi: $(MAN_XML) cat-texi.perl texi.xsl
390390
$(RM) $@+
391391

392392
gitman.info: gitman.texi
393-
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
393+
$(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $<
394394

395395
$(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
396396
$(QUIET_DB2TEXI)$(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@

0 commit comments

Comments
 (0)