Skip to content

Use single-target Makefile patterns for manual pages #6032

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025

Conversation

chrisd8088
Copy link
Member

Beginning with version 4.4 of the GNU make(1) command, the warning message pattern recipe did not update peer target is output if a recipe does not build all of its assigned targets. The next release of GNU make(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 or 5), 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 the man/man1/git-lfs.1 file will be generated from the git-lfs.adoc source file; no man/man5/git-lfs.5 or man/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.

Beginning with version 4.4 of the GNU make(1) command, the warning
message "pattern recipe did not update peer target" is output if
a recipe does not build all of its assigned targets.  The next
release of GNU make(1) will treat this condition as an error; for
reference, see:

  https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html

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 or 5), 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 the "man/man1/git-lfs.1"
file will be generated from the "git-lfs.adoc" source file; no
"man/man5/git-lfs.5" or "man/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:

  https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html
@chrisd8088 chrisd8088 requested a review from a team as a code owner April 15, 2025 21:42
@chrisd8088 chrisd8088 merged commit c4f8cd2 into git-lfs:main Apr 16, 2025
19 of 20 checks passed
@chrisd8088 chrisd8088 deleted the single-man-make-targets branch April 16, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants