Modified: MacRuby/trunk/bin/rubyc (3126 => 3127)
--- MacRuby/trunk/bin/rubyc 2009-12-17 02:37:03 UTC (rev 3126)
+++ MacRuby/trunk/bin/rubyc 2009-12-17 21:36:52 UTC (rev 3127)
@@ -78,15 +78,16 @@
if @files.size > 1 and @output
die "Cannot specify -o with -c or -C and multiple input files"
end
- file = @files[0]
- if File.extname(file) != '.rb'
- die "Given input file `#{file}' must be a Ruby source file (.rb)"
+ @files.each do |file|
+ if File.extname(file) != '.rb'
+ die "Given input file `#{file}' must be a Ruby source file (.rb)"
+ end
+ if @bundle
+ compile_bundle(file, @output)
+ else
+ compile_object(file, @output)
+ end
end
- if @bundle
- compile_bundle(file, @output)
- else
- compile_object(file, @output)
- end
else
die "Cannot specify --static and --dylib at the same time" if @dylib and @static
objs = @files.map do |file|
@@ -326,7 +327,17 @@
end
def feature_name(obj)
- obj.sub(/#{File.extname(obj)}$/, '')
+ # Remove trailing ./ if exists.
+ if obj[0..1] == './'
+ obj[0..1] = ''
+ end
+
+ if obj[0] == '/'
+ $stderr.puts "warning: object file path `#{obj}' is absolute and not relative, this might cause a problem later at runtime"
+ end
+
+ # Strip the extension.
+ obj = obj.sub(/#{File.extname(obj)}$/, '')
end
def gen_tmpfile(base, ext)