mkfiles.pl 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. # List of directories to process
  7. my @dirs = (
  8. ".",
  9. "crypto",
  10. "crypto/md2",
  11. "crypto/md4",
  12. "crypto/md5",
  13. "crypto/sha",
  14. "crypto/mdc2",
  15. "crypto/hmac",
  16. "crypto/cmac",
  17. "crypto/ripemd",
  18. "crypto/des",
  19. "crypto/rc2",
  20. "crypto/rc4",
  21. "crypto/rc5",
  22. "crypto/idea",
  23. "crypto/bf",
  24. "crypto/cast",
  25. "crypto/aes",
  26. "crypto/camellia",
  27. "crypto/seed",
  28. "crypto/modes",
  29. "crypto/bn",
  30. "crypto/rsa",
  31. "crypto/dsa",
  32. "crypto/dso",
  33. "crypto/dh",
  34. "crypto/ec",
  35. "crypto/ecdh",
  36. "crypto/ecdsa",
  37. "crypto/buffer",
  38. "crypto/bio",
  39. "crypto/stack",
  40. "crypto/lhash",
  41. "crypto/rand",
  42. "crypto/err",
  43. "crypto/objects",
  44. "crypto/evp",
  45. "crypto/asn1",
  46. "crypto/pem",
  47. "crypto/x509",
  48. "crypto/x509v3",
  49. "crypto/cms",
  50. "crypto/conf",
  51. "crypto/jpake",
  52. "crypto/txt_db",
  53. "crypto/pkcs7",
  54. "crypto/pkcs12",
  55. "crypto/comp",
  56. "crypto/engine",
  57. "crypto/ocsp",
  58. "crypto/ui",
  59. "crypto/krb5",
  60. #"crypto/store",
  61. "crypto/pqueue",
  62. "crypto/whrlpool",
  63. "crypto/ts",
  64. "crypto/srp",
  65. "ssl",
  66. "apps",
  67. "engines",
  68. "engines/ccgost",
  69. "test",
  70. "tools"
  71. );
  72. %top;
  73. foreach (@dirs) {
  74. &files_dir ($_, "Makefile");
  75. }
  76. exit(0);
  77. sub files_dir
  78. {
  79. my ($dir, $makefile) = @_;
  80. my %sym;
  81. open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
  82. my $s="";
  83. while (<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. $o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
  110. $sym{$s}=($top{$s} or $o);
  111. }
  112. }
  113. print "RELATIVE_DIRECTORY=$dir\n";
  114. foreach (sort keys %sym)
  115. {
  116. print "$_=$sym{$_}\n";
  117. }
  118. if ($dir eq "." && defined($sym{"BUILDENV"}))
  119. {
  120. foreach (split(' ',$sym{"BUILDENV"}))
  121. {
  122. /^(.+)=/;
  123. $top{$1}=$sym{$1};
  124. }
  125. }
  126. print "RELATIVE_DIRECTORY=\n";
  127. close (IN);
  128. }