threads / patch / 10857

patchFix dependencies of parse-options test program

Subject: [PATCH] Fix dependencies of parse-options test program

## tl;dr

6 messages between Nov 13, 2007 and Nov 14, 2007. Diffs are folded; open one to read it.

replies: 5people: 4as markdown or json

Alex Riesen· Nov 13, 2007, 23:16 UTC · lore
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(-)
Show changes to Makefile +2 −0
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· Nov 13, 2007, 23:46 UTC · re: Alex Riesen · lore

Re: [PATCH] Fix dependencies of parse-options test program

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(-)
Show changes to Makefile +4 −0
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
Pierre Habouzit· Nov 14, 2007, 00:08 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Fix dependencies of parse-options test program

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· Nov 14, 2007, 00:12 UTC · re: Pierre Habouzit · lore

Re: [PATCH] Fix dependencies of parse-options test program

Hi,
On Wed, 14 Nov 2007, Pierre Habouzit wrote:
Show 7 quoted lines
> 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· Nov 14, 2007, 08:48 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Fix dependencies of parse-options test program

On Wed, Nov 14, 2007 at 12:12:49AM +0000, Johannes Schindelin wrote:
Show 13 quoted lines
> 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

← back to recent threads