Port c++/78252 from GCC
[deliverable/binutils-gdb.git] / libiberty / maint-tool
index a460b5570e5c42e9c3c5b69bd23881453cc373a5..1c94cdc79cdabf41dd3d56d8d43ff4f86b6580d2 100644 (file)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 # -*- perl -*-
 
-#   Copyright (C) 2001, 2007
+#   Copyright (C) 2001, 2007, 2010, 2014
 #   Free Software Foundation
 #
 # This file is part of the libiberty library.
@@ -76,7 +76,7 @@ sub missing {
     for $f (sort keys %listed) {
        if ($f =~ /(.*)\.c$/) {
            $base = $1;
-           if (! $listed{"$base.o"}) {
+           if (! $listed{"./$base.o"}) {
                print "O $f\n";
            }
        }
@@ -215,6 +215,9 @@ sub deps {
     $crule  = "\tif [ x\"\$(PICFLAG)\" != x ]; then \\\n";
     $crule .= "\t  \$(COMPILE.c) \$(PICFLAG) \$< -o pic/\$@; \\\n";
     $crule .= "\telse true; fi\n";
+    $crule .= "\tif [ x\"\$(NOASANFLAG)\" != x ]; then \\\n";
+    $crule .= "\t  \$(COMPILE.c) \$(PICFLAG) \$(NOASANFLAG) \$< -o noasan/\$@; \\\n";
+    $crule .= "\telse true; fi\n";
     $crule .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n";
     $crule .= "\n";
 
@@ -222,10 +225,11 @@ sub deps {
 
     opendir(INC, $incdir);
     while ($f = readdir INC) {
-       next unless $f =~ /\.h$/;
+       next unless $f =~ /\.h$/ || $f =~ /\.def$/;
        $mine{$f} = "\$(INCDIR)/$f";
        $deps{$f} = join(' ', &deps_for("$incdir/$f"));
     }
+    $mine{'config.h'} = "config.h";
 
     opendir(INC, $srcdir);
     while ($f = readdir INC) {
@@ -233,8 +237,7 @@ sub deps {
        $mine{$f} = "\$(srcdir)/$f";
        $deps{$f} = join(' ', &deps_for("$srcdir/$f"));
     }
-
-    $mine{'config.h'} = "stamp-h";
+    $mine{'config.h'} = "config.h";
 
     open(IN, "$srcdir/Makefile.in");
     open(OUT, ">$srcdir/Makefile.tmp");
@@ -264,7 +267,7 @@ sub deps {
            }
            @deps = sort { &locals_first($a,$b) } keys %scanned;
            $obj = $f;
-           $obj =~ s/\.c$/.o/;
+           $obj =~ s/\.c$/.\$(objext)/;
            $obj = "./$obj:";
            if ($#deps >= 0) {
                print OUT "$obj \$(srcdir)/$f";
This page took 0.026037 seconds and 4 git commands to generate.