Re: Various patches

  • From: Ingo van Lil <inguin@xxxxxx>
  • To: yadex@xxxxxxxxxxxxx
  • Date: Fri, 03 Sep 2010 22:56:02 +0200

 On 09/03/2010 12:39 AM, Ingo van Lil wrote:
* yadex-makedepend.patch:
I couldn't find the "makedepend" tool in F13, so the yadex.dep rule always silently created an empty file (the error messages were hidden by the redirection of stderr). So I've added an alternative way to create the dependencies using gcc.
Oh dear, that patch was broken. My brilliant sed filter would cut the first letter from every target name, thereby generating a perfectly valid yet completely worthless dependency file. Fixed version attached.

Cheers,
Ingo
commit 3621e296bee37e1f575edea7448986b2d0dba563
Author: Ingo van Lil <inguin@xxxxxx>
Date:   Tue Aug 31 21:08:37 2010 +0200

    Use gcc (if available) to generate yadex.dep file.

diff --git a/GNUmakefile b/GNUmakefile
index 61c4652..06b2ee2 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -767,6 +767,12 @@ $(OBJDIR)/files_share.man: $(OBJDIR)/config.share 
$(MAKEFILE)
 cache/yadex.dep: $(SRC_NON_GEN) src/config.h
        @echo "Generating $@"
        @test -d cache || mkdir cache
+ifeq ($(CC), gcc)
+       @gcc -MM $(CFLAGS) $(SRC_NON_GEN) >$(@D)/.$(@F)
+       @sed 's,^.*\.o:,$(OBJDIR)/&,' $(@D)/.$(@F) >$@
+       @sed 's,^.*\.o:,$(DOBJDIR)/&,' $(@D)/.$(@F) >>$@
+       @rm $(@D)/.$(@F)
+else
        @makedepend -f- -Y -Iatclib $(SRC_NON_GEN) 2>/dev/null          \
                | $(AWK) 'sub (/^src/, "") == 1 {                       \
                                print "'$(OBJDIR)'" $$0;                \
@@ -774,6 +780,7 @@ cache/yadex.dep: $(SRC_NON_GEN) src/config.h
                                next;                                   \
                        }' >$(@D)/.$(@F)
        @mv -f $(@D)/.$(@F) $@
+endif
 
 cache/copyright.man: $(MAKEFILE) scripts/copyright docsrc/copyright
        @echo "Generating $@"
@@ -854,7 +861,7 @@ cache/uptodate: scripts/youngest $(SRC_NON_GEN)
 
 # To compile the modules of Yadex
 # (normal and debugging versions)
-include cache/yadex.dep
+-include cache/yadex.dep
 
 # It's simpler to copy config.cc into src/ than to have a
 # compilation rule for just one file.

Other related posts: