author | Mahlon E. Smith <mahlon@martini.nu> |
Sat, 28 Feb 2009 04:54:46 +0000 | |
branch | mahlon-misc |
changeset 12 | 5fd07a9e7e7b |
parent 10 | b1426511fb64 |
permissions | -rw-r--r-- |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
1 |
#!rake |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
2 |
|
0 | 3 |
#!rake |
4 |
||
5 |
# C extension constants |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
6 |
EXT_MAKEFILE = EXTDIR + 'Makefile' |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
7 |
EXT_SOURCES = FileList[ EXTDIR + '*.c' ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
8 |
EXT_SO = EXTDIR + "bsdjail.#{CONFIG['DLEXT']}" |
0 | 9 |
|
10 |
||
11 |
##################################################################### |
|
12 |
### T A S K S |
|
13 |
##################################################################### |
|
14 |
||
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
15 |
# Make both the default task and the spec task depend on building the extension |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
16 |
task :local => :build |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
17 |
task :spec => :build |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
18 |
namespace :spec do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
19 |
task :doc => [ :build ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
20 |
task :quiet => [ :build ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
21 |
task :html => [ :build ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
22 |
task :text => [ :build ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
23 |
end |
0 | 24 |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
25 |
desc "Make the Makefile for the C extension" |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
26 |
file EXT_MAKEFILE.to_s => EXT_SOURCES do |
0 | 27 |
log "Configuring bsdjail C extension" |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
28 |
in_subdirectory( EXTDIR ) do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
29 |
ruby 'extconf.rb' |
0 | 30 |
end |
31 |
end |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
32 |
CLOBBER.include( EXTDIR + 'mkmf.log', EXT_SO ) |
0 | 33 |
|
34 |
desc "Build the C extension" |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
35 |
task :build => [ EXT_MAKEFILE.to_s, *EXT_SOURCES ] do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
36 |
in_subdirectory( EXTDIR ) do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
37 |
sh 'make' |
0 | 38 |
end |
39 |
end |
|
40 |
||
41 |
||
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
42 |
desc "Rebuild the C extension" |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
43 |
task :rebuild => [ :clean, :build ] |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
44 |
|
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
45 |
|
0 | 46 |
task :clean do |
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
47 |
if EXT_MAKEFILE.exist? |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
48 |
in_subdirectory( EXTDIR ) do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
49 |
sh 'make clean' |
0 | 50 |
end |
51 |
end |
|
52 |
end |
|
53 |
||
54 |
task :clobber do |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
55 |
if EXT_MAKEFILE.exist? |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
56 |
in_subdirectory( EXTDIR ) do |
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
57 |
sh 'make distclean' |
0 | 58 |
end |
59 |
end |
|
60 |
end |
|
10
b1426511fb64
Merged changes from trunk@4:8.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
61 |
CLOBBER.include( EXT_MAKEFILE ) |
0 | 62 |