mkfiles.pl revision 142425
1#!/usr/local/bin/perl
2#
3# This is a hacked version of files.pl for systems that can't do a 'make files'.
4# Do a perl util/mkminfo.pl >MINFO to build MINFO
5# Written by Steve Henson 1999.
6
7# List of directories to process
8
9my @dirs = (
10".",
11"crypto",
12"crypto/md2",
13"crypto/md4",
14"crypto/md5",
15"crypto/sha",
16"crypto/mdc2",
17"crypto/hmac",
18"crypto/ripemd",
19"crypto/des",
20"crypto/rc2",
21"crypto/rc4",
22"crypto/rc5",
23"crypto/idea",
24"crypto/bf",
25"crypto/cast",
26"crypto/aes",
27"crypto/bn",
28"crypto/rsa",
29"crypto/dsa",
30"crypto/dso",
31"crypto/dh",
32"crypto/ec",
33"crypto/buffer",
34"crypto/bio",
35"crypto/stack",
36"crypto/lhash",
37"crypto/rand",
38"crypto/err",
39"crypto/objects",
40"crypto/evp",
41"crypto/asn1",
42"crypto/pem",
43"crypto/x509",
44"crypto/x509v3",
45"crypto/conf",
46"crypto/txt_db",
47"crypto/pkcs7",
48"crypto/pkcs12",
49"crypto/comp",
50"crypto/engine",
51"crypto/ocsp",
52"crypto/ui",
53"crypto/krb5",
54"fips",
55"fips/aes",
56"fips/des",
57"fips/dsa",
58"fips/rand",
59"fips/rsa",
60"fips/sha1",
61"ssl",
62"apps",
63"test",
64"tools"
65);
66
67foreach (@dirs) {
68	&files_dir ($_, "Makefile");
69}
70
71exit(0);
72
73sub files_dir
74{
75my ($dir, $makefile) = @_;
76
77my %sym;
78
79open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
80
81my $s="";
82
83while (<IN>)
84	{
85	chop;
86	s/#.*//;
87	if (/^(\S+)\s*=\s*(.*)$/)
88		{
89		$o="";
90		($s,$b)=($1,$2);
91		for (;;)
92			{
93			if ($b =~ /\\$/)
94				{
95				chop($b);
96				$o.=$b." ";
97				$b=<IN>;
98				chop($b);
99				}
100			else
101				{
102				$o.=$b." ";
103				last;
104				}
105			}
106		$o =~ s/^\s+//;
107		$o =~ s/\s+$//;
108		$o =~ s/\s+/ /g;
109
110		$o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
111		$sym{$s}=$o;
112		}
113	}
114
115print "RELATIVE_DIRECTORY=$dir\n";
116
117foreach (sort keys %sym)
118	{
119	print "$_=$sym{$_}\n";
120	}
121print "RELATIVE_DIRECTORY=\n";
122
123close (IN);
124}
125