bcc32/mkexports.rb


DEFINITIONS

This source file includes following functions.


   1  #!./miniruby -s
   2  
   3  SYM = {}
   4  objs = ARGV.collect {|s| s.tr('/', '\\')}
   5  system("tdump -oiPUBDEF -oiPUBD32 #{objs.join(' ')} > pub.def")
   6  sleep(1)
   7  IO.foreach('pub.def'){|l|
   8    next unless /(PUBDEF|PUBD32)/ =~ l
   9    /'(.*?)'/ =~ l
  10    SYM[$1] = true
  11  }
  12  
  13  exports = []
  14  if $name
  15    exports << "Name " + $name
  16  elsif $library
  17    exports << "Library " + $library
  18  end
  19  exports << "Description " + $description.dump if $description
  20  exports << "EXPORTS" << SYM.keys.sort
  21  
  22  if $output
  23    open($output, 'w') {|f| f.puts exports.join("\n")}
  24  else
  25    puts exports.join("\n")
  26  end