git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Makefile: correct default docs build target

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 14, 2025, 22:50 UTC
Message-ID
<xmqqy0y8ywc7.fsf@gitster.g>
In-Reply-To
<xmqq34gg172x.fsf@gitster.g>
Junio C Hamano <gitster@pobox.com> writes:
Show 20 quoted lines
> Adam Dinwoodie <adam@dinwoodie.org> writes:
>
>> Put the "all" target definition near the top of Documentation/Makefile,
>> so that attempts to run make in the documentation directory actually
>> build the documentation.
>
> Good eyes.  To make the intent even more clear, please adopt the
> trick (or "convention") used by t/Makefile and our main Makefile to
> have an empty "all::" at the very beginning of the file, instead of
> moving things around, to avoid this kind of mistake to ever enter
> the repository again.
>
> Thanks.
>
>
> [Footnote]
>
> * If existing "all" targets are single-colon rules by mistake, they
>   need to be corrected.  There is no reason why these phony targets
>   should be anything but double-colon rules).

Yikes, it turns out this is needed, but because there is only one place right now, fixing it is easy. Something like this, perhaps.

diff --git c/Documentation/Makefile w/Documentation/Makefile
index aedfe99d1d..ddf3aa8fac 100644
--- c/Documentation/Makefile
+++ w/Documentation/Makefile
@@ -1,3 +1,6 @@
+# The default target of this Makefile is...
+all::
+
 # Import tree-wide shared Makefile behavior and libraries
 include ../shared.mak
 
@@ -238,7 +241,7 @@ DEFAULT_EDITOR_SQ = $(subst ','\'',$(DEFAULT_EDITOR))
 ASCIIDOC_EXTRA += -a 'git-default-editor=$(DEFAULT_EDITOR_SQ)'
 endif
 
-all: html man
+all:: html man
 
 html: $(DOC_HTML)
 
Previous: Junio C HamanoNext: Adam Dinwoodie
Message 3 of 6 in “Makefile: correct default docs build target”
  1. Makefile: correct default docs build targetAdam Dinwoodie, Feb 14, 2025
  2. Junio C HamanoFeb 14, 2025
  3. Junio C HamanoFeb 14, 2025
  4. Makefile: set default goals in makefilesAdam Dinwoodie, Feb 15, 2025
  5. Patrick SteinhardtFeb 17, 2025
  6. Junio C HamanoFeb 18, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.