2009-10-01 22:17:06 -04:00
|
|
|
require 'mkmf'
|
|
|
|
|
2010-02-16 15:40:05 -05:00
|
|
|
UPSTREAM = File.expand_path(File.dirname(__FILE__) + "/upstream")
|
|
|
|
BUILD = "#{UPSTREAM}/build/v8"
|
2010-01-28 22:37:03 -05:00
|
|
|
|
|
|
|
|
2010-02-16 15:40:05 -05:00
|
|
|
puts "Compiling V8"
|
|
|
|
|
|
|
|
system("cd #{UPSTREAM} && make") or raise "Error compiling V8"
|
2010-01-28 22:37:03 -05:00
|
|
|
|
2010-02-16 15:40:05 -05:00
|
|
|
dir_config('v8', "#{BUILD}/include", "#{BUILD}")
|
|
|
|
have_library('v8') or raise "Unable to find libv8 in #{BUILD}, was there an error compiling it?"
|
2009-10-08 20:46:59 -04:00
|
|
|
|
2010-01-10 22:14:29 -05:00
|
|
|
$CPPFLAGS += " -Wall" unless $CPPFLAGS.split.include? "-Wall"
|
|
|
|
|
2010-02-16 16:30:31 -05:00
|
|
|
CONFIG['LDSHARED'] = '$(CXX) -shared' unless RUBY_PLATFORM =~ /darwin/
|
2010-02-16 00:12:34 -05:00
|
|
|
|
2009-10-08 20:46:59 -04:00
|
|
|
create_makefile('v8')
|
2009-10-15 23:23:53 -04:00
|
|
|
|
|
|
|
# now add a few extra targets
|
|
|
|
File.open("Makefile", "a") do |makefile|
|
|
|
|
makefile.print <<EOF
|
|
|
|
|
|
|
|
test: all
|
2009-10-15 23:45:53 -04:00
|
|
|
@echo running spec...
|
2009-10-16 16:32:01 -04:00
|
|
|
spec -O spec/spec.opts spec/therubyracer_spec.rb
|
2009-10-17 23:45:02 -04:00
|
|
|
|
|
|
|
docs/cpp:
|
|
|
|
mkdir -p docs/cpp
|
|
|
|
|
|
|
|
docs: all docs/cpp
|
|
|
|
@echo Generate C++ docs to docs/cpp/html
|
|
|
|
doxygen Doxyfile
|
|
|
|
|
2009-10-15 23:23:53 -04:00
|
|
|
EOF
|
|
|
|
end
|