mkfiles.pl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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/ripemd",
  17. "crypto/des",
  18. "crypto/rc2",
  19. "crypto/rc4",
  20. "crypto/rc5",
  21. "crypto/idea",
  22. "crypto/bf",
  23. "crypto/cast",
  24. "crypto/aes",
  25. "crypto/camellia",
  26. "crypto/seed",
  27. "crypto/modes",
  28. "crypto/bn",
  29. "crypto/rsa",
  30. "crypto/dsa",
  31. "crypto/dso",
  32. "crypto/dh",
  33. "crypto/ec",
  34. "crypto/ecdh",
  35. "crypto/ecdsa",
  36. "crypto/buffer",
  37. "crypto/bio",
  38. "crypto/stack",
  39. "crypto/lhash",
  40. "crypto/rand",
  41. "crypto/err",
  42. "crypto/objects",
  43. "crypto/evp",
  44. "crypto/asn1",
  45. "crypto/pem",
  46. "crypto/x509",
  47. "crypto/x509v3",
  48. "crypto/cms",
  49. "crypto/conf",
  50. "crypto/jpake",
  51. "crypto/txt_db",
  52. "crypto/pkcs7",
  53. "crypto/pkcs12",
  54. "crypto/comp",
  55. "crypto/engine",
  56. "crypto/ocsp",
  57. "crypto/ui",
  58. "crypto/krb5",
  59. #"crypto/store",
  60. "crypto/pqueue",
  61. "crypto/whrlpool",
  62. "crypto/ts",
  63. "ssl",
  64. "apps",
  65. "engines",
  66. "engines/ccgost",
  67. "test",
  68. "tools"
  69. );
  70. %top;
  71. foreach (@dirs) {
  72. &files_dir ($_, "Makefile");
  73. }
  74. exit(0);
  75. sub files_dir
  76. {
  77. my ($dir, $makefile) = @_;
  78. my %sym;
  79. open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
  80. my $s="";
  81. while (<IN>)
  82. {
  83. chop;
  84. s/#.*//;
  85. if (/^(\S+)\s*=\s*(.*)$/)
  86. {
  87. $o="";
  88. ($s,$b)=($1,$2);
  89. for (;;)
  90. {
  91. if ($b =~ /\\$/)
  92. {
  93. chop($b);
  94. $o.=$b." ";
  95. $b=<IN>;
  96. chop($b);
  97. }
  98. else
  99. {
  100. $o.=$b." ";
  101. last;
  102. }
  103. }
  104. $o =~ s/^\s+//;
  105. $o =~ s/\s+$//;
  106. $o =~ s/\s+/ /g;
  107. $o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
  108. $sym{$s}=($top{$s} or $o);
  109. }
  110. }
  111. print "RELATIVE_DIRECTORY=$dir\n";
  112. foreach (sort keys %sym)
  113. {
  114. print "$_=$sym{$_}\n";
  115. }
  116. if ($dir eq "." && defined($sym{"BUILDENV"}))
  117. {
  118. foreach (split(' ',$sym{"BUILDENV"}))
  119. {
  120. /^(.+)=/;
  121. $top{$1}=$sym{$1};
  122. }
  123. }
  124. print "RELATIVE_DIRECTORY=\n";
  125. close (IN);
  126. }