mkfiles.pl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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/cmac",
  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. "ssl",
  65. "apps",
  66. "engines",
  67. "engines/ccgost",
  68. "test",
  69. "tools"
  70. );
  71. %top;
  72. foreach (@dirs) {
  73. &files_dir ($_, "Makefile");
  74. }
  75. exit(0);
  76. sub files_dir
  77. {
  78. my ($dir, $makefile) = @_;
  79. my %sym;
  80. open (IN, "$dir/$makefile") || die "Can't open $dir/$makefile";
  81. my $s="";
  82. while (<IN>)
  83. {
  84. chop;
  85. s/#.*//;
  86. if (/^(\S+)\s*=\s*(.*)$/)
  87. {
  88. $o="";
  89. ($s,$b)=($1,$2);
  90. for (;;)
  91. {
  92. if ($b =~ /\\$/)
  93. {
  94. chop($b);
  95. $o.=$b." ";
  96. $b=<IN>;
  97. chop($b);
  98. }
  99. else
  100. {
  101. $o.=$b." ";
  102. last;
  103. }
  104. }
  105. $o =~ s/^\s+//;
  106. $o =~ s/\s+$//;
  107. $o =~ s/\s+/ /g;
  108. $o =~ s/\$[({]([^)}]+)[)}]/$top{$1} or $sym{$1}/ge;
  109. $sym{$s}=($top{$s} or $o);
  110. }
  111. }
  112. print "RELATIVE_DIRECTORY=$dir\n";
  113. foreach (sort keys %sym)
  114. {
  115. print "$_=$sym{$_}\n";
  116. }
  117. if ($dir eq "." && defined($sym{"BUILDENV"}))
  118. {
  119. foreach (split(' ',$sym{"BUILDENV"}))
  120. {
  121. /^(.+)=/;
  122. $top{$1}=$sym{$1};
  123. }
  124. }
  125. print "RELATIVE_DIRECTORY=\n";
  126. close (IN);
  127. }