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

Re: [PATCH] Makefile: Add help target

From
Andreas Ericsson <ae@op5.se>
Date
Sep 28, 2010, 12:35 UTC
Message-ID
<4CA1E10F.4080906@op5.se>
In-Reply-To
<AANLkTi=beUW5j4WSGOB__LNP7o60Wep_Y9n4YXOZUMtU@mail.gmail.com>
On 09/28/2010 01:37 PM, Sverre Rabbelier wrote:
Show 30 quoted lines
> Heya,
> 
> On Tue, Sep 28, 2010 at 11:45, Junio C Hamano<gitster@pobox.com>  wrote:
>> I do not look forward to having to maintain a large number of lines that
>> are doomed to go stale
> 
> How often have we changed makefile targets recently? The most recent
> one that I can find is Jakub adding "install-gitweb" in 152d94348f,
> which was back in May 1st. The next one before that is the addition of
> 'gitweb' in 62331ef1637f which was back in January 30th. Besides,
> 'make help' doesn't have to contain _all_ Makefile targets, just the
> important ones that a user is most likely to need. Similar to 'git
> help' itself.
> 
>> and every time we need to touch we need to deal
>> with a lot of noise "@echo '"?
> 
> I don't understand what is particularly bothersome about the leading
> "@echo" lines. Adding or removing a target is still very easy even
> with the leading @echo's, the only thing that would be a PITA is
> reflowing paragraphs, currently, there _are_ no paragraphs, everything
> fits on one line.
> 
>> It might be a bit less distasteful if it were plain text additions at the
>> end of INSTALL file, though.
> 
> That does not help me nearly as much when I want to know how a
> makefile target is called. Am I wrong in asserting that having a "make
> help" target is an accepted "good practice" in the unix world?
> 
help:
    @echo Available make targets:
    @echo -----------------------
    @$(MAKE) --print-data-base --question | \
	sed -n -e '/^Makefile/d' -e 's/^\([a-z0-9_-]*\):.*/\1/p' | \
	sort | uniq | grep -v -e ^git -e ^test-

Automatically self-managing and seems to print most sensible targets. Adjust to taste with whatever's appropriate.

Users with a too-old make program (pre 3.67, I think), won't be able to use the help target, but that's perfectly acceptable imo.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Previous: Sverre RabbelierNext: Michael J Gruber
Message 4 of 24 in “Makefile: Add help target”
  1. Makefile: Add help targetStephen Boyd, Sep 28, 2010
  2. Junio C HamanoSep 28, 2010
  3. Sverre RabbelierSep 28, 2010
  4. Andreas EricssonSep 28, 2010
  5. Makefile: implement help targetMichael J Gruber, Sep 28, 2010
  6. Sverre RabbelierSep 28, 2010
  7. Zbyszek SzmekSep 28, 2010
  8. Ævar Arnfjörð BjarmasonSep 28, 2010
  9. Junio C HamanoSep 28, 2010
  10. Michael J GruberSep 28, 2010
  11. Ævar Arnfjörð BjarmasonSep 28, 2010
  12. [PATCHv2] Makefile: implement help targetMichael J Gruber, Sep 28, 2010
  13. Sverre RabbelierSep 28, 2010
  14. Jakub NarebskiSep 28, 2010
  15. Brandon CaseySep 28, 2010
  16. Michael J GruberSep 29, 2010
  17. Jeff KingSep 29, 2010
  18. Michael J GruberSep 29, 2010
  19. Jeff KingSep 29, 2010
  20. Junio C HamanoSep 29, 2010
  21. [PATCHv3] Makefile: implement help targetMichael J Gruber, Sep 29, 2010
  22. Junio C HamanoSep 29, 2010
  23. Michael J GruberSep 30, 2010
  24. yj2133011Sep 29, 2010

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.