Skip to content

Commit

Permalink
Merge pull request rubyjs#34 from nurse/use-gmake
Browse files Browse the repository at this point in the history
Use gmake if the make is not GNU Make.
  • Loading branch information
Logan Lowell committed Apr 2, 2012
2 parents 18a6c85 + 6db53cc commit cd9ac89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require 'bundler'
require 'bundler/setup'

Bundler::GemHelper.install_tasks
MAKE = /GNU/ =~ `make --version 2>/dev/null` ? 'make' : 'gmake'

# desc "remove all generated artifacts except built v8 objects"
# task :clean do
Expand All @@ -24,7 +25,7 @@ Bundler::GemHelper.install_tasks
#
# desc "build v8 with debugging symbols (much slower)"
# task "v8:debug" do
# sh "cd ext/v8/upstream && make debug"
# sh "cd ext/v8/upstream && #{MAKE} debug"
# end

# Rake::ExtensionTask.new("libv8", eval(File.read("libv8.gemspec"))) do |ext|
Expand Down Expand Up @@ -74,14 +75,14 @@ task :compile, [:version] do |t, options|
puts "Compiling V8 (#{options.version})..."
Rake::Task[:checkout].invoke(options.version)
Dir.chdir(File.join('lib', 'libv8')) do
`make`
system(MAKE)
end
end

desc "Clean up from the build"
task :clean do |t, options|
Dir.chdir(File.join('lib', 'libv8')) do
`make clean`
system(MAKE, 'clean')
end
end

Expand Down
2 changes: 1 addition & 1 deletion ext/libv8/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def crash(str)

Dir.chdir(Pathname(__FILE__).dirname.join('..', '..', 'lib', 'libv8')) do
puts "Compiling V8..."
`make`
/GNU/ =~ `make --version 2>/dev/null` ? `make` : `gmake`
end

create_makefile('libv8')

0 comments on commit cd9ac89

Please sign in to comment.