Rakefile.local
author Mahlon E. Smith <mahlon@martini.nu>
Tue, 03 Mar 2009 22:23:45 +0000
changeset 7 4460fc10c6a3
parent 3 7f6da371e2ce
permissions -rw-r--r--
* Now with 87% more hot jail action! * Predeclared all C methods in jail.h, so they could be arranged in logical order in jail.c * Fixed the extconf namespace. * Added rdoc. * Added usage examples, demonstrating jls, jexec, and jail ruby equivalents. * Re-added the "attach and execute within a block" code. * Added Enumerable and Comparable support. * Return 'path' as a Pathname object. TODO: * Create the actual 'jParallel' shell binary, now that we have a good backend framework. * Tests? How? * Add support for recently committed (will be part of 7.2-RELEASE) multiple IPs per jail, and jail labels.

#!rake

#!rake

# C extension constants
EXT_MAKEFILE  = EXTDIR + 'Makefile'
EXT_SOURCES   = FileList[ EXTDIR + '*.c' ]
EXT_SO        = EXTDIR + "bsdjail.#{CONFIG['DLEXT']}"


#####################################################################
###	T A S K S
#####################################################################

# Make both the default task and the spec task depend on building the extension
task :local => :build
task :spec => :build
namespace :spec do
	task :doc   => [ :build ]
	task :quiet => [ :build ]
	task :html  => [ :build ]
	task :text  => [ :build ]
end

desc "Make the Makefile for the C extension"
file EXT_MAKEFILE.to_s => EXT_SOURCES do
	log "Configuring bsdjail C extension"
	in_subdirectory( EXTDIR ) do
		ruby 'extconf.rb'
	end
end
CLOBBER.include( EXTDIR + 'mkmf.log', EXT_SO )

desc "Build the C extension"
task :build => [ EXT_MAKEFILE.to_s, *EXT_SOURCES ] do
	in_subdirectory( EXTDIR ) do
		sh 'make'
	end
end


desc "Rebuild the C extension"
task :rebuild => [ :clean, :build ]


task :clean do
	if EXT_MAKEFILE.exist?
		in_subdirectory( EXTDIR ) do
			sh 'make clean'
		end
	end
end	

task :clobber do
	if EXT_MAKEFILE.exist?
		in_subdirectory( EXTDIR ) do
			sh 'make distclean'
		end
	end
end	
CLOBBER.include( EXT_MAKEFILE )