Parent

Syckle::Plugins::Autotools

Autotools Compile Plugin

The Autotools plugin utilizes extconf.rb and standard Makefile(s) to compile extensions.

TODO: win32 cross-compile ?

Constants

MAKE_COMMAND

Attributes

static[RW]

Compile statically? Applies only to compile method. (false)

Public Instance Methods

clean() click to toggle source

Remove enough compile products for a clean compile.

# File lib/plugins/syckle/autotools.rb, line 63
def clean
  make 'clean'
end
clobber() click to toggle source
Alias for: distclean
compile() click to toggle source

Compile extensions.

# File lib/plugins/syckle/autotools.rb, line 52
def compile
  configure
  if static
    make 'static'
  else
    make
  end
end
compiles?() click to toggle source

Check to see if this project has extensions that need to be compiled.

# File lib/plugins/syckle/autotools.rb, line 37
def compiles?
  !extensions.empty?
end
configure() click to toggle source

Create Makefile(s).

# File lib/plugins/syckle/autotools.rb, line 83
def configure
  extensions.each do |directory|
    next if File.exist?(File.join(directory, 'Makefile'))
    report "configuring #{directory}"
    cd(directory) do
      sh "ruby extconf.rb"
    end
  end
end
distclean() click to toggle source

Remove all compile products.

# File lib/plugins/syckle/autotools.rb, line 71
def distclean
  make 'distclean'
  extensions.each do |directory|
    makefile = File.join(directory, 'Makefile')
    rm(makefile) if File.exist?(makefile)
  end
end
Also aliased as: clobber
extensions() click to toggle source

Extension directories. Often this will simply be ‘ext’. but sometimes more then one extension is needed and are kept in separate directories. This works by looking for ext/*/.c files, where ever they are is considered an extension directory.

# File lib/plugins/syckle/autotools.rb, line 46
def extensions
  @extensions ||= Dir['ext/**/*.c'].collect{ |file| File.dirname(file) }.uniq
end
initialize_defaults() click to toggle source
# File lib/plugins/syckle/autotools.rb, line 31
def initialize_defaults
  @static = false
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.