[llvm-commits] CVS: llvm/utils/GenLibDeps.pl

Reid Spencer reid at x10sys.com
Sun Mar 19 14:08:14 PST 2006



Changes in directory llvm/utils:

GenLibDeps.pl updated: 1.3 -> 1.4
---
Log message:

Add a -flat option for generating the library dependencies in a flat 
format with one library per line, similar to a makefile dependency list.


---
Diffs of the changes:  (+31 -5)

 GenLibDeps.pl |   36 +++++++++++++++++++++++++++++++-----
 1 files changed, 31 insertions(+), 5 deletions(-)


Index: llvm/utils/GenLibDeps.pl
diff -u llvm/utils/GenLibDeps.pl:1.3 llvm/utils/GenLibDeps.pl:1.4
--- llvm/utils/GenLibDeps.pl:1.3	Wed Jan  5 11:29:29 2005
+++ llvm/utils/GenLibDeps.pl	Sun Mar 19 16:08:01 2006
@@ -9,6 +9,16 @@
 # Syntax:   GenLibDeps.pl <directory_with_libraries_in_it>
 #
 
+# Parse arguments... 
+while (scalar(@ARGV) and ($_ = $ARGV[0], /^[-+]/)) {
+  shift;
+  last if /^--$/;  # Stop processing arguments on --
+
+  # List command line options here...
+  if (/^-flat$/)     { $FLAT = 1; next; }
+  print "Unknown option: $_ : ignoring!\n";
+}
+
 # Give first option a name.
 my $Directory = $ARGV[0];
 
@@ -58,7 +68,11 @@
   my $lib = $_[0];
   my $lib_ns = $lib;
   $lib_ns =~ s/(.*)\.[oa]/$1/;
-  print "  <dt><b>$lib</b</dt><dd><ul>\n";
+  if ($FLAT) {
+    print "$lib:";
+  } else {
+    print "  <dt><b>$lib</b</dt><dd><ul>\n";
+  }
   open UNDEFS, 
     "nm -u $Directory/$lib | grep ' U ' | sed -e 's/         U //' | sort | uniq |";
   open DEPENDS,
@@ -80,7 +94,11 @@
   open DF, "<GenLibDeps.out";
   while (<DF>) {
     chomp;
-    print "    <li>$_</li>\n";
+    if ($FLAT) {
+      print " $_";
+    } else {
+      print "    <li>$_</li>\n";
+    }
     $suffix = substr($_,length($_)-1,1);
     $_ =~ s/(.*)\.[oa]/$1/;
     if ($suffix eq "a") {
@@ -90,7 +108,11 @@
     }
   }
   close DF;
-  print "  </ul></dd>\n";
+  if ($FLAT) {
+    print "\n";
+  } else {
+    print "  </ul></dd>\n";
+  }
 }
 
 # Make sure we flush on write. This is slower but correct based on the way we
@@ -98,7 +120,9 @@
 $| = 1;
 
 # Print the definition list tag
-print "<dl>\n";
+if (!$FLAT) {
+  print "<dl>\n";
+}
 
 open DOT, "| $DotPath -Tgif > libdeps.gif";
 
@@ -125,4 +149,6 @@
 close DOT;
 
 # Print end tag of definition list element
-print "</dl>\n";
+if (!$FLAT) {
+  print "</dl>\n";
+}






More information about the llvm-commits mailing list