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