Use single-target Makefile
patterns for manual pages
#6032
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Beginning with version 4.4 of the GNU
make(1)
command, the warning messagepattern recipe did not update peer target
is output if a recipe does not build all of its assigned targets. The next release of GNUmake(1)
will treat this condition as an error, per the v4.4 release notes.Our Makefile contains several pattern rules which generate roff and HTML manual pages from our AsciiDoc source files, and these specify multiple targets because the AsciiDoc source files lack a manual section number (e.g.,
1
or5
), while the target files must contain those numbers (e.g.,man/man1/git-lfs.1
).With the latest versions of GNU
make(1)
, these rules cause the command to output its warning message, because they do not generate all the specified targets. For instance, only theman/man1/git-lfs.1
file will be generated from thegit-lfs.adoc
source file; noman/man5/git-lfs.5
orman/man7/git-lfs.7
files will be created.To avoid problems in the future, we rewrite the rules which generate our finished man pages so they only specify the targets that will be created by the given recipe.
We also adjust our use of the
$^
automatic variable to$<
because we only define a single prerequisite (i.e., source file) for each recipe, and so can reference it explicitly with$<
, per the documentation.