mirror of
https://github.com/samsonjs/compiler.git
synced 2026-03-25 08:45:52 +00:00
There is no binary assembler support for Darwin yet! I'm not sure when I will dive into the details of generating a Mach-O binary from Ruby or C. [MERGED] Binary assembler support. It *should* work on ELF but it needs testing on Linux.
25 lines
684 B
Ruby
Executable file
25 lines
684 B
Ruby
Executable file
#!/usr/bin/env ruby
|
|
|
|
ROOT = Dir.pwd.sub(/\/test.*$/, '')
|
|
$LOAD_PATH << ROOT
|
|
|
|
require 'build'
|
|
|
|
# usage: build.rb <func> [binformat]
|
|
#
|
|
# ([format] will go before [binformat])
|
|
|
|
def main
|
|
func = ARGV[0].to_s
|
|
format = 'asm' # 'bin' only assembles one or two
|
|
# instructions right now, but support
|
|
# is in place
|
|
binformat = (ARGV[1] ? ARGV[1] : 'elf').downcase
|
|
platform = `uname -s`.chomp.downcase
|
|
print "testing #{func} ... "
|
|
success = run( build("test_#{func}.code", platform, format, binformat) )
|
|
puts success == 0 ? "pass" : "FAIL! (#{success})"
|
|
exit(success.to_i)
|
|
end
|
|
|
|
main if $0 == __FILE__
|