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-- |
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 | 3 |
#!rake |
4 |
||
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 | 9 |
|
10 |
||
11 |
##################################################################### |
|
12 |
### T A S K S |
|
13 |
##################################################################### |
|
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 | 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 | 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 | 30 |
end |
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 | 33 |
|
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 | 38 |
end |
39 |
end |
|
40 |
||
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 | 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 | 50 |
end |
51 |
end |
|
52 |
end |
|
53 |
||
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 | 58 |
end |
59 |
end |
|
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 | 62 |