Service
The Autotools plugin utilizes extconf.rb and standard Makefile(s) to compile extensions.
TODO: win32 cross-compile ?
Remove enough compile products for a clean compile.
# File lib/plugins/syckle/autotools.rb, line 63 def clean make 'clean' end
Compile extensions.
# File lib/plugins/syckle/autotools.rb, line 52 def compile configure if static make 'static' else make end end
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
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
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
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
Generated with the Darkfish Rdoc Generator 2.