mkfiles.pl 2.3 KB
Newer Older
1 2 3 4 5 6 7 8 9
#!/usr/local/bin/perl
#
# This is a hacked version of files.pl for systems that can't do a 'make files'.
# Do a perl util/mkminfo.pl >MINFO to build MINFO
# Written by Steve Henson 1999.

# List of directories to process

my @dirs = (
10
".",
11 12
"crypto",
"crypto/md2",
13
"crypto/md4",
14 15 16 17 18 19 20 21 22 23 24 25
"crypto/md5",
"crypto/sha",
"crypto/mdc2",
"crypto/hmac",
"crypto/ripemd",
"crypto/des",
"crypto/rc2",
"crypto/rc4",
"crypto/rc5",
"crypto/idea",
"crypto/bf",
"crypto/cast",
26
"crypto/aes",
27
"crypto/camellia",
B
Bodo Möller 已提交
28
"crypto/seed",
29
"crypto/modes",
30
"crypto/cmac",
31 32 33
"crypto/bn",
"crypto/rsa",
"crypto/dsa",
34
"crypto/dso",
35
"crypto/dh",
D
 
Dr. Stephen Henson 已提交
36
"crypto/ec",
B
Bodo Möller 已提交
37
"crypto/ecdh",
38
"crypto/ecdsa",
39 40 41 42 43 44 45 46 47 48 49 50
"crypto/buffer",
"crypto/bio",
"crypto/stack",
"crypto/lhash",
"crypto/rand",
"crypto/err",
"crypto/objects",
"crypto/evp",
"crypto/asn1",
"crypto/pem",
"crypto/x509",
"crypto/x509v3",
51
"crypto/cms",
52
"crypto/conf",
53
"crypto/jpake",
54 55
"crypto/txt_db",
"crypto/pkcs7",
56
"crypto/pkcs12",
57
"crypto/comp",
58
"crypto/engine",
59
"crypto/ocsp",
R
Richard Levitte 已提交
60
"crypto/ui",
61
"crypto/krb5",
62
#"crypto/store",
63
"crypto/pqueue",
64
"crypto/whrlpool",
65
"crypto/ts",
B
Ben Laurie 已提交
66
"crypto/srp",
67 68
"fips",
"fips/aes",
69
"fips/cmac",
70 71 72
"fips/des",
"fips/dsa",
"fips/dh",
D
Dr. Stephen Henson 已提交
73
"fips/ecdh",
74
"fips/ecdsa",
75 76 77 78 79
"fips/hmac",
"fips/rand",
"fips/rsa",
"fips/utl",
"fips/sha",
80 81
"ssl",
"apps",
82
"engines",
D
Dr. Stephen Henson 已提交
83
"engines/ccgost",
84 85 86 87
"test",
"tools"
);

88 89
%top;

90 91
my $fipscanisteronly = 0;

92
foreach (@dirs) {
93
	next if ($fipscanisteronly && !(-d $_));
94
	&files_dir ($_, "Makefile");
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
}

exit(0);

sub files_dir
{
my ($dir, $makefile) = @_;

my %sym;

open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";

my $s="";

while (<IN>)
	{
	chop;
	s/#.*//;
	if (/^(\S+)\s*=\s*(.*)$/)
		{
		$o="";
		($s,$b)=($1,$2);
		for (;;)
			{
			if ($b =~ /\\$/)
				{
				chop($b);
				$o.=$b." ";
				$b=<IN>;
				chop($b);
				}
			else
				{
				$o.=$b." ";
				last;
				}
			}
		$o =~ s/^\s+//;
		$o =~ s/\s+$//;
		$o =~ s/\s+/ /g;

136 137
		$o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
		$sym{$s}=($top{$s} or $o);
138 139 140 141 142 143 144 145 146
		}
	}

print "RELATIVE_DIRECTORY=$dir\n";

foreach (sort keys %sym)
	{
	print "$_=$sym{$_}\n";
	}
147 148 149 150 151 152 153 154 155
if ($dir eq "." && defined($sym{"BUILDENV"}))
	{
	foreach (split(' ',$sym{"BUILDENV"}))
		{
		/^(.+)=/;
		$top{$1}=$sym{$1};
		}
	}

156 157 158
print "RELATIVE_DIRECTORY=\n";

close (IN);
159
if ($dir eq "." && $sym{FIPSCANISTERONLY} eq "y")
160 161 162
	{
	$fipscanisteronly = 1;
	}
163
}