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.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
     1
#!rake
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
     2
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     3
#!rake
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     4
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     5
# C extension constants
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
     6
EXT_MAKEFILE  = EXTDIR + 'Makefile'
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
     7
EXT_SOURCES   = FileList[ EXTDIR + '*.c' ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
     8
EXT_SO        = EXTDIR + "bsdjail.#{CONFIG['DLEXT']}"
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
     9
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    10
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    11
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    12
###	T A S K S
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    13
#####################################################################
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    14
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    15
# Make both the default task and the spec task depend on building the extension
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    16
task :local => :build
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    17
task :spec => :build
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    18
namespace :spec do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    19
	task :doc   => [ :build ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    20
	task :quiet => [ :build ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    21
	task :html  => [ :build ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    22
	task :text  => [ :build ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    23
end
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    24
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    25
desc "Make the Makefile for the C extension"
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    26
file EXT_MAKEFILE.to_s => EXT_SOURCES do
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    27
	log "Configuring bsdjail C extension"
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    28
	in_subdirectory( EXTDIR ) do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    29
		ruby 'extconf.rb'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    30
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    31
end
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    32
CLOBBER.include( EXTDIR + 'mkmf.log', EXT_SO )
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    33
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    34
desc "Build the C extension"
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    35
task :build => [ EXT_MAKEFILE.to_s, *EXT_SOURCES ] do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    36
	in_subdirectory( EXTDIR ) do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    37
		sh 'make'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    38
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    39
end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    40
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    41
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    42
desc "Rebuild the C extension"
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    43
task :rebuild => [ :clean, :build ]
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    44
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    45
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    46
task :clean do
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    47
	if EXT_MAKEFILE.exist?
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    48
		in_subdirectory( EXTDIR ) do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    49
			sh 'make clean'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    50
		end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    51
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    52
end	
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    53
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    54
task :clobber do
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    55
	if EXT_MAKEFILE.exist?
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    56
		in_subdirectory( EXTDIR ) do
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    57
			sh 'make distclean'
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    58
		end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    59
	end
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    60
end	
3
7f6da371e2ce * Converted from Mkrf-based build back to mkmf.
Michael Granger <ged@FaerieMUD.org>
parents: 0
diff changeset
    61
CLOBBER.include( EXT_MAKEFILE )
0
92d00ff32c56 Initial checkin
Michael Granger <ged@FaerieMUD.org>
parents:
diff changeset
    62