]> git.ipfire.org Git - thirdparty/git.git/commit
Documentation/Makefile: fix "make info" regression in dad9cd7d518
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 5 Apr 2022 19:56:20 +0000 (21:56 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Apr 2022 16:43:48 +0000 (09:43 -0700)
commit8af0699b7a86a6f3c2fe9b745bcbe56ec777feac
treede39e194b4cf6aeb0f3241037f84ad35fe3c7003
parent05b8b82542ac9e2e17312eac263728d88c9b3d97
Documentation/Makefile: fix "make info" regression in dad9cd7d518

Fix a regression in my dad9cd7d518 (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 5cefc33bffd (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 <adam@dinwoodie.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/Makefile