X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fmaint-tool;h=f100dd4a0d7bb05c8553cb50cc001d9ffed73ec1;hb=77ad80922bf3042536fc41b19cc0bf230ea485b4;hp=6b9bf7f2cdbe419957a92c0046271740899e63ff;hpb=bb32582095610c5d98aa6285bfe92a7cf52b5047;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/maint-tool b/libiberty/maint-tool index 6b9bf7f2cd..f100dd4a0d 100644 --- a/libiberty/maint-tool +++ b/libiberty/maint-tool @@ -1,8 +1,7 @@ #!/usr/bin/perl # -*- perl -*- -# Copyright (C) 2001 -# Free Software Foundation +# Copyright (C) 2001-2019 Free Software Foundation, Inc. # # This file is part of the libiberty library. # Libiberty is free software; you can redistribute it and/or @@ -17,8 +16,8 @@ # # You should have received a copy of the GNU Library General Public # License along with libiberty; see the file COPYING.LIB. If not, -# write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. +# write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +# Boston, MA 02110-1301, USA. # # Originally written by DJ Delorie @@ -76,7 +75,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"; } } @@ -145,7 +144,6 @@ sub undoc { next unless /^\# *define/; s/\# *define *//; } - next if $filename =~ /mpw\.c/; s/ VPARAMS//; s/ *\177.*//; @@ -213,11 +211,20 @@ sub locals_first { 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"; + $incdir = shift @ARGV; 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")); } @@ -259,11 +266,11 @@ sub deps { } @deps = sort { &locals_first($a,$b) } keys %scanned; $obj = $f; - $obj =~ s/\.c$/.o/; - $obj = "$obj:"; + $obj =~ s/\.c$/.\$(objext)/; + $obj = "./$obj:"; if ($#deps >= 0) { - print OUT $obj; - $len = length($obj); + print OUT "$obj \$(srcdir)/$f"; + $len = length("$obj $f"); for $dt (@deps) { $d = $mine{$dt}; if ($len + length($d) > 70) { @@ -275,7 +282,12 @@ sub deps { } } print OUT "\n"; + } else { + print OUT "$obj \$(srcdir)/$f\n"; } + $c = $crule; + $c =~ s@\$\<@\$\(srcdir\)\/$f@g; + print OUT $c; } } closedir(S);