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

[PATCH 00/12] Re: Makefile: add missing header dependency rules

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 26, 2010, 15:43 UTC
Message-ID
<20100126154357.GA4895@progeny.tock>
In-Reply-To
<7v3a1u6bfz.fsf@alter.siamese.dyndns.org>
Junio C Hamano wrote:
> Jonathan Nieder <jrnieder@gmail.com> writes:
Show 6 quoted lines
>> These patches are independent of the jn/makefile topic.  I sent them
>> before, but I screwed up the sender so nobody received them.  Anyway,
>> perhaps they could be useful.
>
> I found all of them sensible but it seems to be based on version that is a
> bit behind...

Thanks. Patches 1-5 below are those I sent before, rebased against maint. Since last time, remote-curl.o gained a few more dependencies, which are included.

The remainder of this series is based on a merge of master and patches 1-5:

 Patch 6 adds another missing header dependency rule.  It is not
 included with the others because it applies to master, not maint.
 Patches 7-12 revisit the topic of generating header dependency
 rules on the fly.  I updated them to produce patches 1-6, so I
 thought, why not get some feedback on their present state?

Patch 7 clumps the header dependency rules together. I think this makes them more readable; more importantly, later this will allow ifdef'ing them out later in one fell swoop.

Patches 8-9 and 11 list all targets that can depend on headers in a new OBJECTS variable, for use in patches 10 and 12.

Patch 10 generates header dependency rules on the fly. The resulting dependency rules contain no useless dependencies (unlike the hard-coded ones where almost everything depends on $(LIB_H)), so this might be interesting to people wishing to speed up the edit-compile-run cycle.

This only works with gcc. It should be possible to teach the relevant options to clink.pl if there is demand, but not SCO cc.

Patch 12 is what I am most interested in: it uses the computed dependencies to check that the hard-coded dependency rules are correct. In the long term, maybe we will be able to get rid of the hard-coded header dep rules altogether; in the short term, I am hoping this checker can be useful for avoiding problems with the hard-coded rules without spending too much human time on it.

Enjoy,
Jonathan Nieder (12):
  Makefile: add missing header file dependencies
  Makefile: make sure test helpers are rebuilt when headers change
  Makefile: remove wt-status.h from LIB_H
  Makefile: clean up http-walker.o dependency rules
  Makefile: drop dependency on $(wildcard */*.h)
  Makefile: transport.o depends on branch.h now
  Makefile: rearrange dependency rules
  Makefile: disable default implicit rules
  Makefile: list generated object files in OBJECTS macro
  Makefile: lazily compute header dependencies
  Makefile: list standalone program object files in PROGRAM_OBJS
  Teach Makefile to check header dependencies
Previous: Junio C HamanoNext: Jonathan Nieder
Message 8 of 27 in “Makefile: add missing header dependency rules”
  1. 0/5 Makefile: add missing header dependency rulesJonathan Nieder, Jan 23, 2010
  2. 1/5 Makefile: add missing header file dependenciesJonathan Nieder, Jan 23, 2010
  3. 2/5 Makefile: make sure test helpers are rebuilt when headers changeJonathan Nieder, Jan 23, 2010
  4. 3/5 Makefile: remove wt-status.h from LIB_HJonathan Nieder, Jan 23, 2010
  5. 4/5 Makefile: clean up http-walker.o dependency rulesJonathan Nieder, Jan 23, 2010
  6. 5/5 Makefile: drop dependency on $(wildcard */*.h)Jonathan Nieder, Jan 23, 2010
  7. Junio C HamanoJan 25, 2010
  8. 00/12 Re: Makefile: add missing header dependency rulesJonathan Nieder, Jan 26, 2010
  9. 01/12 Makefile: add missing header file dependenciesJonathan Nieder, Jan 26, 2010
  10. 02/12 Makefile: make sure test helpers are rebuilt when headers changeJonathan Nieder, Jan 26, 2010
  11. 03/12 Makefile: remove wt-status.h from LIB_HJonathan Nieder, Jan 26, 2010
  12. 04/12 Makefile: clean up http-walker.o dependency rulesJonathan Nieder, Jan 26, 2010
  13. 05/12 Makefile: drop dependency on $(wildcard */*.h)Jonathan Nieder, Jan 26, 2010
  14. 06/12 Makefile: transport.o depends on branch.h nowJonathan Nieder, Jan 26, 2010
  15. 07/12 Makefile: rearrange dependency rulesJonathan Nieder, Jan 26, 2010
  16. 08/12 Makefile: disable default implicit rulesJonathan Nieder, Jan 26, 2010
  17. 09/12 Makefile: list generated object files in OBJECTSJonathan Nieder, Jan 26, 2010
  18. 10/12 Makefile: lazily compute header dependenciesJonathan Nieder, Jan 26, 2010
  19. 11/12 Makefile: list standalone program object files in PROGRAM_OBJSJonathan Nieder, Jan 26, 2010
  20. 11/12 Makefile: list standalone program object files in PROGRAM_OBJSJonathan Nieder, Jan 27, 2010
  21. 12/12 Teach Makefile to check header dependenciesJonathan Nieder, Jan 26, 2010
  22. Junio C HamanoJan 31, 2010
  23. Jonathan NiederJan 31, 2010
  24. Junio C HamanoJan 31, 2010
  25. 14/12 Makefile: always remove .depend directories on 'make clean'Jonathan Nieder, Jan 31, 2010
  26. 13/12 Makefile: tuck away generated makefile fragments in .dependJonathan Nieder, Jan 31, 2010
  27. Jonathan NiederJan 26, 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.