-
Notifications
You must be signed in to change notification settings - Fork 206
/
Rakefile
34 lines (26 loc) · 853 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
require "bundler"
Bundler::GemHelper.install_tasks
require "rbconfig"
require "rake/testtask"
require "rake/extensiontask"
Rake::ExtensionTask.new('rules') do |task|
task.config_options = ARGV[1..-1] || []
task.lib_dir = File.join(*['src', 'rulesrb'])
task.ext_dir = File.join(*['src', 'rulesrb'])
end
namespace :rules do
task :clean do
RbConfig::CONFIG['configure_args'] =~ /with-make-prog\=(\w+)/
make_program = $1 || ENV['make']
unless make_program then
make_program = (/mswin/ =~ RUBY_PLATFORM) ? 'nmake' : 'make'
end
system("cd deps/hiredis && #{make_program} clean")
system("cd src/rules && #{make_program} clean")
end
end
# "rake clean" should also clean bundled rules
Rake::Task[:clean].enhance(['rules:clean'])
# Build from scratch
task :rebuild => [:clean, :compile]
task :default => [:rebuild]