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