Skip to content

Commit

Permalink
fixed compiling. (had only been running tests which require and use t…
Browse files Browse the repository at this point in the history
…he build method directly)
  • Loading branch information
samsonjs committed Jan 14, 2010
1 parent 9d31c1e commit 558d5e7
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@

# usage: build.rb <filename> [elf | macho ] [asm | bin]

DefaultBinFormats = Hash.new('bin')
def binformat(p,f) DefaultBinFormats[p]=f end
binformat 'darwin', 'macho'
binformat 'linux', 'elf'

def main
filename = ARGV[0].to_s
raise "can't read #{filename}" unless File.readable?(filename)
binformat = ARGV[1] ? ARGV[1].downcase : 'elf'
format = ARGV[2] ? ARGV[2].downcase : 'asm'
platform = `uname -s`.chomp.downcase
puts "Building #{format} from #{filename} for #{platform}, binformat is #{binformat} ..."
outfile = build(filename, platform, format, binformat)
binformat = ARGV[1] ? ARGV[1].downcase : DefaultBinFormats[platform]
puts "Building #{filename} for #{platform}, binformat is #{binformat} ..."
outfile = build(filename, platform, binformat)
puts outfile
exit
end
Expand Down

0 comments on commit 558d5e7

Please sign in to comment.