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

Re: [PATCH] Makefile: add help target

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 8, 2022, 18:58 UTC
Message-ID
<xmqq1qy7mmgf.fsf@gitster.g>
In-Reply-To
<YlBVBlwNVc8mEjn5@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
> I could definitely see something like "make help" being helpful, since
> make itself doesn't have a convenient way to list all of a Makefile's
> targets.
But is listing all useful to begin with?  I doubt it.

Most useful targets are all .PHONYs, so a possible approach is to make them double-colon rules, and have a section at the top, next to where we explain "# The default target of this Makefile is...", that lists all of them there, and have a rule

	# The default target of this Makefile is...
	all::
	+# Common targets
	+test::
	+doc::
	+...
        +help::
        +        sed -e '/help::/q' Makefile
        # Import tree-wide shared Makefile behavior and libraries
        include shared.mak
perhaps?
> I worry about this list getting stale, though.
Absolutely.

A well-curated list of common targets, maybe, but I find nothing interesting in the posted patch that lists way too many.

I also suspect that a well-curated list at the top would eliminate the need for the "help" target in the first place. Between "make help" and "less Makefile", the latter is much more intuitive.

Thanks.
Previous: Ævar Arnfjörð Bjarmason
Message 5 of 5 in “Makefile: add help target”
  1. Makefile: add help targetElia Pinto, Apr 8, 2022
  2. Philip OakleyApr 8, 2022
  3. Taylor BlauApr 8, 2022
  4. Ævar Arnfjörð BjarmasonApr 8, 2022
  5. Junio C HamanoApr 8, 2022

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.