method
make
v2_5_5 -
Show latest stable
- Class:
Gem::Ext::Builder
make(dest_path, results)public
No documentation available.
# File lib/rubygems/ext/builder.rb, line 30
def self.make(dest_path, results)
unless File.exist? 'Makefile' then
raise Gem::InstallError, 'Makefile not found'
end
# try to find make program from Ruby configure arguments first
RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
make_program = ENV['MAKE'] || ENV['make'] || $1
unless make_program then
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
destdir = '"DESTDIR=%s"' % ENV['DESTDIR'] if RUBY_VERSION > '2.0'
['clean', '', 'install'].each do |target|
# Pass DESTDIR via command line to override what's in MAKEFLAGS
cmd = [
make_program,
destdir,
target
].join(' ').rstrip
begin
run(cmd, results, "make #{target}".rstrip)
rescue Gem::InstallError
raise unless target == 'clean' # ignore clean failure
end
end
end