Permalink
Browse files

Improving build scripts

  • Loading branch information...
1 parent e7f154d commit c256a5075c48ef95badc9fa47bb3600f823a45e5 @eric eric committed Sep 9, 2013
Showing with 18 additions and 13 deletions.
  1. +8 −0 Rakefile
  2. +10 −13 ext/Rakefile
View
8 Rakefile
@@ -90,6 +90,14 @@ namespace :build do
Rake::Task['build'].invoke
end
+
+ task :clobber do
+ cd 'ext' do
+ sh 'rake clobber'
+ end
+
+ Rake::Task['build'].invoke
+ end
end
task :build do
View
23 ext/Rakefile
@@ -1,5 +1,7 @@
require 'rbconfig'
+ZKRB_WRAPPER = %w[zkrb_wrapper.c zkrb_wrapper.h]
+
namespace :zkrb do
task :clean do
if File.exists?('Makefile')
@@ -11,34 +13,29 @@ namespace :zkrb do
end
task :clobber => :clean do
- rm_rf %w[Makefile c lib bin include ._c]
+ rm_rf %w[Makefile c lib bin include ._c] + ZKRB_WRAPPER
end
end
-task :clean => 'zkrb:clean'
-task :clobber => 'zkrb:clobber'
-
-GENERATE_GVL_CODE_RB = 'generate_gvl_code.rb'
+task :clean => 'zkrb:clean'
+task :clobber => 'zkrb:clobber'
+task :wrappers => ZKRB_WRAPPER
+task :default => :build
-file 'zkrb_wrapper.c' => GENERATE_GVL_CODE_RB do
+file 'zkrb_wrapper.c' => 'generate_gvl_code.rb' do
sh "ruby generate_gvl_code.rb code"
end
-file 'zkrb_wrapper.h' => GENERATE_GVL_CODE_RB do
+file 'zkrb_wrapper.h' => 'generate_gvl_code.rb' do
sh "ruby generate_gvl_code.rb headers"
end
-ZKRB_WRAPPER = %w[zkrb_wrapper.c zkrb_wrapper.h]
-
-task :wrappers => ZKRB_WRAPPER
-
file 'Makefile' do
sh "ruby extconf.rb"
end
-task :build => ['Makefile', ZKRB_WRAPPER].flatten do
+task :build => [ 'Makefile', :wrappers ] do
sh 'make'
end
-task :default => :build

0 comments on commit c256a50

Please sign in to comment.