# Broken dependencies..

4 messages from 2007-02-27 to 2007-02-28. Participants: Linus Torvalds, Johannes Schindelin, Andy Parkins.
Thread: https://gitlist.dev/t/7002

## Linus Torvalds, 2007-02-27 23:46

Subject: Broken dependencies..
Message-ID: <Pine.LNX.4.64.0702271543080.12485@woody.linux-foundation.org>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0702271543080.12485%40woody.linux-foundation.org

```

Try this on the current git archive:

	git checkout master
	make clean
	make
	...
	git checkout next
	make

and at least I get 

	...
	gcc -g -O2 -Wall  -DSHA1_HEADER='<openssl/sha.h>' -DETC_GITCONFIG='"/home/torvalds/etc/gitconfig"' -DNO_STRLCPY -o git-local-fetch   local-fetch.o fetch.o libgit.a xdiff/lib.a -lz  -lcrypto
	fetch.o: In function `process_object':
	/home/torvalds/git/fetch.c:137: undefined reference to `type_names'
	fetch.o: In function `typename':
	/home/torvalds/git/object.h:46: undefined reference to `type_names'
	collect2: ld returned 1 exit status

apparently because fetch.c wasn't recompiled and it used the old fetch.o.

Ugh. I take full blame for the Makefile being a total mess, and us not 
doing proper dependencies, but I'm too lazy to fix it. Any ideas on how to 
generate real dependency data so that we don't have these kinds of things 
(I bet there are other files than just fetch.c that lack the full header 
file dependencies, this one just happened to trigger now)?

		Linus

```

## Johannes Schindelin, 2007-02-27 23:55

Subject: Re: Broken dependencies..
Message-ID: <Pine.LNX.4.63.0702280053140.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702280053140.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <Pine.LNX.4.64.0702271543080.12485@woody.linux-foundation.org>

```
Hi,

On Tue, 27 Feb 2007, Linus Torvalds wrote:

> 	/home/torvalds/git/fetch.c:137: undefined reference to `type_names'
> 	fetch.o: In function `typename':

I realized that too, and forgot to send out the patch:

-- snip --
[PATCH] fetch.o depends on the headers, too.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

 Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 20acc78..ce284fa 100644
--- a/Makefile
+++ b/Makefile
@@ -788,7 +788,7 @@ git-http-push$X: revision.o http.o http-push.o $(GITLIBS)
 	$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)
 
-$(LIB_OBJS) $(BUILTIN_OBJS): $(LIB_H)
+$(LIB_OBJS) $(BUILTIN_OBJS) fetch.o: $(LIB_H)
 $(patsubst git-%$X,%.o,$(PROGRAMS)): $(LIB_H) $(wildcard */*.h)
 $(DIFF_OBJS): diffcore.h
 
-- snap --

Ciao,
Dscho

```

## Andy Parkins, 2007-02-28 09:00

Subject: Re: Broken dependencies..
Message-ID: <200702280900.22982.andyparkins@gmail.com>
URL: https://gitlist.dev/e/200702280900.22982.andyparkins%40gmail.com
In-Reply-To: <Pine.LNX.4.64.0702271543080.12485@woody.linux-foundation.org>

```
On Tuesday 2007 February 27 23:46, Linus Torvalds wrote:

> doing proper dependencies, but I'm too lazy to fix it. Any ideas on how to
> generate real dependency data so that we don't have these kinds of things
> (I bet there are other files than just fetch.c that lack the full header
> file dependencies, this one just happened to trigger now)?

Would gcc's "-MM" help?  I think qmake uses them when it's generating 
Makefiles.


Andy

-- 
Dr Andy Parkins, M Eng (hons), MIET
andyparkins@gmail.com

```

## Johannes Schindelin, 2007-02-28 15:00

Subject: Re: Broken dependencies..
Message-ID: <Pine.LNX.4.63.0702281600280.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702281600280.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <200702280900.22982.andyparkins@gmail.com>

```
Hi,

On Wed, 28 Feb 2007, Andy Parkins wrote:

> On Tuesday 2007 February 27 23:46, Linus Torvalds wrote:
> 
> > doing proper dependencies, but I'm too lazy to fix it. Any ideas on 
> > how to generate real dependency data so that we don't have these kinds 
> > of things (I bet there are other files than just fetch.c that lack the 
> > full header file dependencies, this one just happened to trigger now)?
> 
> Would gcc's "-MM" help?  I think qmake uses them when it's generating 
> Makefiles.

Would that play nicely with Sun' CC some people seem to use to compile 
Git?

Ciao,
Dscho

```
