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