Rakefile.local
author Mahlon E. Smith <mahlon@martini.nu>
Sat, 28 Feb 2009 04:54:46 +0000
branchmahlon-misc
changeset 12 5fd07a9e7e7b
parent 10 b1426511fb64
permissions -rw-r--r--
* Added jail header dependencies for mkmf Makefile. * Renamed header file (bsdjail -> jail) * Fixed copyright * Initial commit of primary functionality * Attach to a running jail * Create a new jail * List and instantiate existing jails * Fetch information about existing jails * Still needs... * Attach "in a block" fleshed out * Documentation and better comments * Tests (of some kind, this will be tough) * Update for not-yet-MFC'ed multiple IP jail patch in FBSD 7.2-STABLE

#!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 )