# [PATCH] Fix dependencies of parse-options test program

6 messages from 2007-11-13 to 2007-11-14. Participants: Alex Riesen, Johannes Schindelin, Junio C Hamano, Pierre Habouzit.
Thread: https://gitlist.dev/t/10857

## Alex Riesen, 2007-11-13 23:16

Subject: [PATCH] Fix dependencies of parse-options test program
Message-ID: <20071113231636.GJ3268@steel.home>
URL: https://gitlist.dev/e/20071113231636.GJ3268%40steel.home

```
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
---

An old test-parse-options was breaking t0040.

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

diff --git a/Makefile b/Makefile
index cd6d469..af827f6 100644
--- a/Makefile
+++ b/Makefile
@@ -999,6 +999,8 @@ test-date$X: date.o ctype.o
 
 test-delta$X: diff-delta.o patch-delta.o
 
+test-parse-options$X: parse-options.o
+
 .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
 
 test-%$X: test-%.o $(GITLIBS)
-- 
1.5.3.5.668.g22088

```

## Johannes Schindelin, 2007-11-13 23:46

Subject: Re: [PATCH] Fix dependencies of parse-options test program
Message-ID: <Pine.LNX.4.64.0711132345310.4362@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711132345310.4362%40racer.site
In-Reply-To: <20071113231636.GJ3268@steel.home>

```
Hi,

apparently I forgot to send this patch, which I thought was only relevant 
in the builtin-commit branch of mine:

-- snipsnap --
[PATCH] Makefile: add correct dependencies for test-parse-options

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
 Makefile |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index bda8762..2abb8da 100644
--- a/Makefile
+++ b/Makefile
@@ -996,6 +996,10 @@ test-date$X: date.o ctype.o
 
 test-delta$X: diff-delta.o patch-delta.o
 
+test-parse-options$X: parse-options.o
+
+test-parse-options.o: parse-options.h
+
 .PRECIOUS: $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))
 
 test-%$X: test-%.o $(GITLIBS)
-- 
1.5.3.5.1769.gc3bdd

```

## Junio C Hamano, 2007-11-14 00:03

Subject: Re: [PATCH] Fix dependencies of parse-options test program
Message-ID: <7vir45r8uo.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vir45r8uo.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <20071113231636.GJ3268@steel.home>

```
Ah, I saw the breakage once but was too late at night to see
what was wrong myself.  Thanks.

```

## Pierre Habouzit, 2007-11-14 00:08

Subject: Re: [PATCH] Fix dependencies of parse-options test program
Message-ID: <20071114000833.GC22836@artemis.corp>
URL: https://gitlist.dev/e/20071114000833.GC22836%40artemis.corp
In-Reply-To: <Pine.LNX.4.64.0711132345310.4362@racer.site>

```
On Tue, Nov 13, 2007 at 11:46:20PM +0000, Johannes Schindelin wrote:
> Hi,
> 
> apparently I forgot to send this patch, which I thought was only relevant 
> in the builtin-commit branch of mine:

  Btw is there a reason why git doesn't use the gcc -M* options to have
proper dependency informations ? I understand not everyone has a gcc
compiler at hand, but still, most of the compilers know how to do that.
We could even borough depcomp from automake for that task.

  I've been bitten by dependencies issues in git many times, and it's
only now that I understand that it was dependency issues, I always
assumed git Makefiles dealt with that already, and I believe that'd be
nice to have a real solution for that.

-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```

## Johannes Schindelin, 2007-11-14 00:12

Subject: Re: [PATCH] Fix dependencies of parse-options test program
Message-ID: <Pine.LNX.4.64.0711140012210.4362@racer.site>
URL: https://gitlist.dev/e/Pine.LNX.4.64.0711140012210.4362%40racer.site
In-Reply-To: <20071114000833.GC22836@artemis.corp>

```
Hi,

On Wed, 14 Nov 2007, Pierre Habouzit wrote:

> On Tue, Nov 13, 2007 at 11:46:20PM +0000, Johannes Schindelin wrote:
> 
> > apparently I forgot to send this patch, which I thought was only 
> > relevant in the builtin-commit branch of mine:
> 
>   Btw is there a reason why git doesn't use the gcc -M* options to have
> proper dependency informations ?

I suspect the reason is that we do not want to depend on gcc...

Ciao,
Dscho

```

## Pierre Habouzit, 2007-11-14 08:48

Subject: Re: [PATCH] Fix dependencies of parse-options test program
Message-ID: <20071114084819.GA18926@artemis.corp>
URL: https://gitlist.dev/e/20071114084819.GA18926%40artemis.corp
In-Reply-To: <Pine.LNX.4.64.0711140012210.4362@racer.site>

```
On Wed, Nov 14, 2007 at 12:12:49AM +0000, Johannes Schindelin wrote:
> Hi,
> 
> On Wed, 14 Nov 2007, Pierre Habouzit wrote:
> 
> > On Tue, Nov 13, 2007 at 11:46:20PM +0000, Johannes Schindelin wrote:
> > 
> > > apparently I forgot to send this patch, which I thought was only 
> > > relevant in the builtin-commit branch of mine:
> > 
> >   Btw is there a reason why git doesn't use the gcc -M* options to have
> > proper dependency informations ?
> 
> I suspect the reason is that we do not want to depend on gcc...

  right, but like said, other compilers can generate them, only with a
different CLI switch, and non withstanding this problem, there are tools
to generate such kind of information easily.

  Though for those who care about this issue, this is hackable easily
using config.mak, here is how:

    CFLAGS += -MMD -MF $(@D)/.$(@F:.o=.dep)
    -include $(wildcard .*.dep */.*.dep) GIT-VERSION-FILE

It's a quick hack, but allow gcc + gnu make (I believe $(@D) is GNU)
users not to be bitten hard by those dependency issues.

The reason why I include GIT-VERSION-FILE again is that many make
complain if -include gets an empty like as an argument, and passing
/dev/null on certains occasions triggers warnings about /dev/null having
a date in the future on some machines for a reason I never found.
-- 
·O·  Pierre Habouzit
··O                                                madcoder@debian.org
OOO                                                http://www.madism.org

```
