X-Git-Url: http://git.sourceforge.jp/view?a=blobdiff_plain;f=libiberty%2Fmaint-tool;h=36b92034f33c2c9e055094e4686e0952678e3ad6;hb=682cba57066400bb6415dc06b6dba9b7e850d376;hp=ceeb48dbf39ff14a338e91850f819667fa4323e5;hpb=98b6fc70cac3a41dedfc45e5f84bf7f2f71e3092;p=pf3gnuchains%2Fgcc-fork.git diff --git a/libiberty/maint-tool b/libiberty/maint-tool index ceeb48dbf39..36b92034f33 100644 --- a/libiberty/maint-tool +++ b/libiberty/maint-tool @@ -1,7 +1,7 @@ #!/usr/bin/perl # -*- perl -*- -# Copyright (C) 2001 +# Copyright (C) 2001, 2007, 2010 # Free Software Foundation # # This file is part of the libiberty library. @@ -17,8 +17,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 +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"; } } @@ -145,7 +145,6 @@ sub undoc { next unless /^\# *define/; s/\# *define *//; } - next if $filename =~ /mpw\.c/; s/ VPARAMS//; s/ *\177.*//; @@ -213,6 +212,12 @@ 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 .= "\t\$(COMPILE.c) \$< \$(OUTPUT_OPTION)\n"; + $crule .= "\n"; + $incdir = shift @ARGV; opendir(INC, $incdir); @@ -223,6 +228,14 @@ sub deps { } $mine{'config.h'} = "config.h"; + opendir(INC, $srcdir); + while ($f = readdir INC) { + next unless $f =~ /\.h$/; + $mine{$f} = "\$(srcdir)/$f"; + $deps{$f} = join(' ', &deps_for("$srcdir/$f")); + } + $mine{'config.h'} = "config.h"; + open(IN, "$srcdir/Makefile.in"); open(OUT, ">$srcdir/Makefile.tmp"); while () { @@ -251,11 +264,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) { @@ -267,7 +280,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);