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