# Header files not mentioned in the makefile

4 messages from 2008-03-03 to 2008-03-03. Participants: Martin Koegler, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/12454

## Martin Koegler, 2008-03-03 07:24

Subject: Header files not mentioned in the makefile
Message-ID: <20080303072424.GA25623@auto.tuwien.ac.at>
URL: https://gitlist.dev/e/20080303072424.GA25623%40auto.tuwien.ac.at

```
When I modified fetch-pack.h I was surprised by the fact, that it does
not result in rebuilding all object files. In fact, no file was
rebuilt. It turned out, that fetch-pack.h was not mentioned in the
Makefile.

A quick search (on next) showed, that other header files are also not
taking part in dependency checking:

$for a in `ls *.h`; do grep "$a" Makefile >/dev/null || (echo "missing: $a"; grep "$a" *.c|grep include) ; done
missing: branch.h
  branch.c:#include "branch.h"
  builtin-branch.c:#include "branch.h"
  builtin-checkout.c:#include "branch.h"
  builtin-reset.c:#include "branch.h"
missing: bundle.h
  builtin-bundle.c:#include "bundle.h"
  bundle.c:#include "bundle.h"
  transport.c:#include "bundle.h"
missing: color.h
  builtin-branch.c:#include "color.h"
  builtin-commit.c:#include "color.h"
  builtin-config.c:#include "color.h"
  builtin-diff.c:#include "color.h"
  builtin-log.c:#include "color.h"
  color.c:#include "color.h"
  diff.c:#include "color.h"
  wt-status.c:#include "color.h"
missing: exec_cmd.h
  builtin-add.c:#include "exec_cmd.h"
  builtin-archive.c:#include "exec_cmd.h"
  builtin-cat-file.c:#include "exec_cmd.h"
  builtin-describe.c:#include "exec_cmd.h"
  builtin-fetch-pack.c:#include "exec_cmd.h"
  builtin-init-db.c:#include "exec_cmd.h"
  builtin-revert.c:#include "exec_cmd.h"
  config.c:#include "exec_cmd.h"
  daemon.c:#include "exec_cmd.h"
  exec_cmd.c:#include "exec_cmd.h"
  git.c:#include "exec_cmd.h"
  help.c:#include "exec_cmd.h"
  http-push.c:#include "exec_cmd.h"
  receive-pack.c:#include "exec_cmd.h"
  run-command.c:#include "exec_cmd.h"
  shell.c:#include "exec_cmd.h"
  upload-pack.c:#include "exec_cmd.h"
missing: fetch-pack.h
  builtin-fetch-pack.c:#include "fetch-pack.h"
  transport.c:#include "fetch-pack.h"
missing: interpolate.h
  builtin-merge-recursive.c:#include "interpolate.h"
  daemon.c:#include "interpolate.h"
  interpolate.c:#include "interpolate.h"
  ll-merge.c:#include "interpolate.h"
missing: merge-recursive.h
  builtin-checkout.c:#include "merge-recursive.h"
  builtin-merge-recursive.c:#include "merge-recursive.h"
missing: reachable.h
  builtin-prune.c:#include "reachable.h"
  builtin-reflog.c:#include "reachable.h"
  reachable.c:#include "reachable.h"
missing: send-pack.h
  builtin-send-pack.c:#include "send-pack.h"
  transport.c:#include "send-pack.h"
missing: shortlog.h
  builtin-log.c:#include "shortlog.h"
  builtin-shortlog.c:#include "shortlog.h"
missing: tar.h
  archive-tar.c:#include "tar.h"
  builtin-tar-tree.c:#include "tar.h"
missing: thread-utils.h
  builtin-pack-objects.c:#include "thread-utils.h"
missing: walker.h
  builtin-http-fetch.c:#include "walker.h"
  http-walker.c:#include "walker.h"
  transport.c:#include "walker.h"
  walker.c:#include "walker.h"
missing: xdiff-interface.h
  builtin-blame.c:#include "xdiff-interface.h"
  builtin-merge-file.c:#include "xdiff-interface.h"
  builtin-merge-recursive.c:#include "xdiff-interface.h"
  builtin-rerere.c:#include "xdiff-interface.h"
  combine-diff.c:#include "xdiff-interface.h"
  diff.c:#include "xdiff-interface.h"
  grep.c:#include "xdiff-interface.h"
  ll-merge.c:#include "xdiff-interface.h"
  merge-file.c:#include "xdiff-interface.h"
  merge-tree.c:#include "xdiff-interface.h"
  xdiff-interface.c:#include "xdiff-interface.h"

Adding this header files to LIB_H should fix the problem.

mfg Martin Kögler

```

## Johannes Schindelin, 2008-03-03 11:47

Subject: Re: Header files not mentioned in the makefile
Message-ID: <alpine.LSU.1.00.0803031146310.22527@racer.site>
URL: https://gitlist.dev/e/alpine.LSU.1.00.0803031146310.22527%40racer.site
In-Reply-To: <20080303072424.GA25623@auto.tuwien.ac.at>

```
Hi,

On Mon, 3 Mar 2008, Martin Koegler wrote:

> When I modified fetch-pack.h I was surprised by the fact, that it does 
> not result in rebuilding all object files. In fact, no file was rebuilt. 
> It turned out, that fetch-pack.h was not mentioned in the Makefile.
> 
> A quick search (on next) showed, that other header files are also not
> taking part in dependency checking:
> 
> $for a in `ls *.h`; do grep "$a" Makefile >/dev/null || (echo "missing: $a"; grep "$a" *.c|grep include) ; done
> missing: branch.h

Somehow I miss "wt-status.h" in your list.

Ciao,
Dscho

```

## Martin Koegler, 2008-03-03 18:55

Subject: Re: Header files not mentioned in the makefile
Message-ID: <20080303185524.GA26790@auto.tuwien.ac.at>
URL: https://gitlist.dev/e/20080303185524.GA26790%40auto.tuwien.ac.at
In-Reply-To: <alpine.LSU.1.00.0803031146310.22527@racer.site>

```
On Mon, Mar 03, 2008 at 11:47:01AM +0000, Johannes Schindelin wrote:
> On Mon, 3 Mar 2008, Martin Koegler wrote:
> 
> > When I modified fetch-pack.h I was surprised by the fact, that it does 
> > not result in rebuilding all object files. In fact, no file was rebuilt. 
> > It turned out, that fetch-pack.h was not mentioned in the Makefile.
> > 
> > A quick search (on next) showed, that other header files are also not
> > taking part in dependency checking:
> > 
> > $for a in `ls *.h`; do grep "$a" Makefile >/dev/null || (echo "missing: $a"; grep "$a" *.c|grep include) ; done
> > missing: branch.h
> 
> Somehow I miss "wt-status.h" in your list.

There is a dependency for wt-status.h, so it does not show up in
my grep:
 builtin-revert.o wt-status.o: wt-status.h

But this is complete:
$ grep wt-status.h *.c
builtin-commit.c:#include "wt-status.h"
builtin-revert.c:#include "wt-status.h"
wt-status.c:#include "wt-status.h"


mfg Martin Kögler

```

## Junio C Hamano, 2008-03-03 19:22

Subject: Re: Header files not mentioned in the makefile
Message-ID: <7vr6erhasw.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vr6erhasw.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20080303185524.GA26790@auto.tuwien.ac.at>

```
mkoegler@auto.tuwien.ac.at (Martin Koegler) writes:

> On Mon, Mar 03, 2008 at 11:47:01AM +0000, Johannes Schindelin wrote:
>> On Mon, 3 Mar 2008, Martin Koegler wrote:
>> 
>> > When I modified fetch-pack.h I was surprised by the fact, that it does 
>> > not result in rebuilding all object files. In fact, no file was rebuilt. 
>> > It turned out, that fetch-pack.h was not mentioned in the Makefile.
>> > 
>> > A quick search (on next) showed, that other header files are also not
>> > taking part in dependency checking:
>> > 
>> > $for a in `ls *.h`; do grep "$a" Makefile >/dev/null || (echo "missing: $a"; grep "$a" *.c|grep include) ; done
>> > missing: branch.h
>> 
>> Somehow I miss "wt-status.h" in your list.
>
> There is a dependency for wt-status.h, so it does not show up in
> my grep:
>  builtin-revert.o wt-status.o: wt-status.h
>
> But this is complete:
> $ grep wt-status.h *.c
> builtin-commit.c:#include "wt-status.h"
> builtin-revert.c:#include "wt-status.h"
> wt-status.c:#include "wt-status.h"

I've been meaning to do a Makefile clean-up.

 * Various lists (SCRIPT_SH, SCRIPT_PERL, PROGRAMS, LIB_H, ...).  Make
   them into a sorted one-item-per-line of the form "LIB_H += foo.h".

 * Dependencies.  We probably should auto-maintain them ("gcc -M",
   makedepend etc).

 * Removing libgit.a; it used to be that what we had was a collection of
   independent programs that link various but not all object files, and it
   was a very easy and low maintenance way to tell the linker "grab
   whatever you need from libgit.a".  These days, however, we roll almost
   everything into "git" as built-ins, and the private library outlived
   its usefulness.  We can instead just link in *.o files to build "git"
   directly.

I'd probably do the first item from the above list, immediately after all
the 1.5.5 topics graduat to 'master' and v1.5.5-rc1 is tagged; at that
point, by definition, we will not have new topics on 'master' until the
final.  This conversion should not be difficult nor disruptive from
technical point of view, but it needs to be done at the right moment when
everything is quiescent.



```
