Sha256: b3724f90b8c0b88cbb834f2844a0d387b0c558cb85af49a9475ee57c45546a37

Contents?: true

Size: 1.12 KB

Versions: 67

Compression:

Stored size: 1.12 KB

Contents

namespace :extconf do
  extension = File.basename(__FILE__, '.rake')

  ext = "ext/#{extension}"
  ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}"
  ext_files = FileList[
    "#{ext}/*.c",
    "#{ext}/*.h",
    "#{ext}/*.rl",
    "#{ext}/extconf.rb",
    "#{ext}/Makefile",
    # "lib"
  ]


  task :compile => extension do
    if Dir.glob("**/#{extension}.{o,so,dll}").length == 0
      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
      STDERR.puts "Gem actually failed to build.  Your system is"
      STDERR.puts "NOT configured properly to build #{GEM_NAME}."
      STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
      exit(1)
    end
  end

  desc "Builds just the #{extension} extension"
  task extension.to_sym => ["#{ext}/Makefile", ext_so ]

  file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do
    Dir.chdir(ext) do ruby "extconf.rb" end
  end

  file ext_so => ext_files do
    Dir.chdir(ext) do
      sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') do |ok, res|
        if !ok
          require "fileutils"
          FileUtils.rm Dir.glob('*.{so,o,dll,bundle}')
        end
      end
    end
  end
end

Version data entries

67 entries across 67 versions & 9 rubygems

Version Path
brianmario-bzip2-ruby-0.2.4 tasks/extconf/bz2.rake
brianmario-bzip2-ruby-0.2.5 tasks/extconf/bz2.rake
newt-0.9.2 tasks/extconf/ruby_newt.rake
newt-0.9.1 tasks/extconf/ruby_newt.rake
newt-0.9.0 tasks/extconf/ruby_newt.rake
newt-0.0.1 tasks/extconf/ruby_newt.rake
ruby-cyrus-sasl-0.0.2 tasks/extconf/rubysasl.rake
ruby-cyrus-sasl-0.0.1 tasks/extconf/rubysasl.rake
cassowary-1.0.1 tasks/extconf/cassowary.rake
hubris-0.0.6 tasks/extconf/stub.rake
cassowary-1.0.0 tasks/extconf/cassowary.rake
hubris-0.0.5 tasks/extconf/stub.rake
hubris-0.0.4 tasks/extconf/stub.rake
newgem-1.5.3 rubygems_generators/extconf/templates/tasks/extconf_name.rake
bzip2-ruby-0.2.3 tasks/extconf/bz2.rake
bzip2-ruby-0.2.4 tasks/extconf/bz2.rake
bzip2-ruby-0.2.5 tasks/extconf/bz2.rake
bzip2-ruby-0.2.6 tasks/extconf/bz2.rake
newgem-1.5.0 rubygems_generators/extconf/templates/tasks/extconf_name.rake
newgem-1.5.1 rubygems_generators/extconf/templates/tasks/extconf_name.rake