Release coccinelle-0.2.0
[bpt/coccinelle.git] / scripts / stat_directories_complete.pl
1 # Copyright 2005-2009, Ecole des Mines de Nantes, University of Copenhagen
2 # Yoann Padioleau, Julia Lawall, Rene Rydhof Hansen, Henrik Stuart, Gilles Muller, Nicolas Palix
3 # This file is part of Coccinelle.
4 #
5 # Coccinelle is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, according to version 2 of the License.
8 #
9 # Coccinelle is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with Coccinelle. If not, see <http://www.gnu.org/licenses/>.
16 #
17 # The authors reserve the right to distribute this or future versions of
18 # Coccinelle under other licenses.
19
20
21 #!/usr/bin/perl
22
23 #usage:
24
25 if(@ARGV < 1) { die "usage: stat_directories_complete.pl [M|C|B]";}
26 my $kind = "$ARGV[0]";
27
28
29 my $subdirs = `make subdirs`;
30 #my $subdirs = "rule9";
31 #my $subdirs = "rule1";
32 chomp $subdirs;
33 @subdirs = split /\s+/, $subdirs;
34
35
36 my $i = 0;
37 foreach my $dir (@subdirs) {
38 if(-e "$dir/") {
39 #print "RULE: $dir\n";
40
41 my ($s) =
42 `cd $dir; ~/coccinelle/scripts/stat_directory_complete.pl | grep $kind:`;
43 chomp $s;
44 $i++;
45 #print "M$i.$s\n";
46 $s =~ s/$kind:/$kind$i./;
47 print "$s\n";
48 }
49
50 }