desc
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/perl
#
# Perl script to find comments for a particular
# test case.
#
sub ParseIndexFile
{
open(INDEXFILE, $IndexFile) || die "Couldn't open $IndexFile \n";
while ($IndexInputLine = <INDEXFILE>)
{
if ($IndexInputLine =~ /^#$Dependency/)
{
print $IndexInputLine;
}
}
close(INDEXFILE);
}
sub ParseDependencyLine
{
$ContinuedLine = 1;
$InputLine =~ s/^.*:[ ]?//;
while ($ContinuedLine)
{
@Dependencies = split(/[ \t\n]+/, $InputLine);
foreach $j (0 .. $#Dependencies)
{
$Dependency = $Dependencies[$j];
$Dependency =~ s/^.*\///;
$Dependency =~ s/\..*\\?$//;
if ($Dependency =~ /inp/)
{
$IndexFile = "InData/index";
&ParseIndexFile;
}
elsif (($Dependency =~ /auto/) || ($Dependency =~ /hand/))
{
$IndexFile = "TmemData/index";
&ParseIndexFile;
}
elsif ($Dependency =~ /tile/)
{
$IndexFile = "TileData/index";
&ParseIndexFile;
}
elsif (($Dependency =~ /\\/) || ($Dependency =~ /^\s+$/) || (!$Dependency))
{
}
elsif (($Dependency =~ /tctm/) || ($Dependency =~ /\$\$@/))
{
}
else
{
print "Unrecognized index file ->$Dependency<- \n";
}
}
if ($InputLine =~ /\\/)
{
$InputLine = <MAKEFILE>;
$InputLine =~ s/^.*:[ ]?//;
}
else
{
$ContinuedLine = 0;
}
}
}
print "\n";
foreach $i (0 .. $#ARGV)
{
open(MAKEFILE, "Makefile") || die "Couldn't open Makefile \n";
print "Description for $ARGV[$i]: \n";
while ($InputLine = <MAKEFILE>)
{
if ($InputLine =~ /^#$ARGV[$i]/)
{
print $InputLine;
}
elsif ($InputLine =~ /$ARGV[$i]:/)
{
$InputLine = <MAKEFILE>;
&ParseDependencyLine;
}
}
close(MAKEFILE);
printf("\n");
}