mkfiles.pl revision 68651
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/bn",
27"crypto/rsa",
28"crypto/dsa",
29"crypto/dso",
30"crypto/dh",
31"crypto/buffer",
32"crypto/bio",
33"crypto/stack",
34"crypto/lhash",
35"crypto/rand",
36"crypto/err",
37"crypto/objects",
38"crypto/evp",
39"crypto/asn1",
40"crypto/pem",
41"crypto/x509",
42"crypto/x509v3",
43"crypto/conf",
44"crypto/txt_db",
45"crypto/pkcs7",
46"crypto/pkcs12",
47"crypto/comp",
48"ssl",
49"rsaref",
50"apps",
51"test",
52"tools"
53);
54
55foreach (@dirs) {
56	&files_dir ($_, "Makefile.ssl");
57}
58
59exit(0);
60
61sub files_dir
62{
63my ($dir, $makefile) = @_;
64
65my %sym;
66
67open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
68
69my $s="";
70
71while (<IN>)
72	{
73	chop;
74	s/#.*//;
75	if (/^(\S+)\s*=\s*(.*)$/)
76		{
77		$o="";
78		($s,$b)=($1,$2);
79		for (;;)
80			{
81			if ($b =~ /\\$/)
82				{
83				chop($b);
84				$o.=$b." ";
85				$b=<IN>;
86				chop($b);
87				}
88			else
89				{
90				$o.=$b." ";
91				last;
92				}
93			}
94		$o =~ s/^\s+//;
95		$o =~ s/\s+$//;
96		$o =~ s/\s+/ /g;
97
98		$o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g;
99		$sym{$s}=$o;
100		}
101	}
102
103print "RELATIVE_DIRECTORY=$dir\n";
104
105foreach (sort keys %sym)
106	{
107	print "$_=$sym{$_}\n";
108	}
109print "RELATIVE_DIRECTORY=\n";
110
111close (IN);
112}
113