Changeset 156 for trunk/Rakefile
- Timestamp:
- 11/12/2007 10:16:46 (13 months ago)
- Files:
-
- 1 modified
-
trunk/Rakefile (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Rakefile
r152 r156 13 13 BIN = "*.{bundle,jar,so,obj,pdb,lib,def,exp}" 14 14 ARCHLIB = "lib/#{::Config::CONFIG['arch']}" 15 CLEAN.include ["ext/hpricot_scan/#{BIN}", "lib/**/#{BIN}", 'ext/hpricot_scan/Makefile', 15 CLEAN.include ["ext/hpricot_scan/#{BIN}", "ext/fast_xs/#{BIN}", "lib/**/#{BIN}", 16 'ext/fast_xs/Makefile', 'ext/hpricot_scan/Makefile', 16 17 '**/.*.sw?', '*.gem', '.config'] 17 18 RDOC_OPTS = ['--quiet', '--title', 'The Hpricot Reference', '--main', 'README', '--inline-source'] … … 67 68 end 68 69 69 extension = "hpricot_scan" 70 ext = "ext/hpricot_scan" 71 ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}" 72 ext_files = FileList[ 73 "#{ext}/*.c", 74 "#{ext}/*.h", 75 "#{ext}/*.rl", 76 "#{ext}/extconf.rb", 77 "#{ext}/Makefile", 78 "lib" 79 ] 70 ['hpricot_scan', 'fast_xs'].each do |extension| 71 ext = "ext/#{extension}" 72 ext_so = "#{ext}/#{extension}.#{Config::CONFIG['DLEXT']}" 73 ext_files = FileList[ 74 "#{ext}/*.c", 75 "#{ext}/*.h", 76 "#{ext}/*.rl", 77 "#{ext}/extconf.rb", 78 "#{ext}/Makefile", 79 "lib" 80 ] 81 82 desc "Builds just the #{extension} extension" 83 task extension.to_sym => ["#{ext}/Makefile", ext_so ] 84 85 file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do 86 Dir.chdir(ext) do ruby "extconf.rb" end 87 end 88 89 file ext_so => ext_files do 90 Dir.chdir(ext) do 91 sh(PLATFORM =~ /win32/ ? 'nmake' : 'make') 92 end 93 mkdir_p ARCHLIB 94 cp ext_so, ARCHLIB 95 end 96 end 80 97 81 98 task "lib" do … … 84 101 85 102 desc "Compiles the Ruby extension" 86 task :compile => [:hpricot_scan ] do103 task :compile => [:hpricot_scan, :fast_xs] do 87 104 if Dir.glob(File.join(ARCHLIB,"hpricot_scan.*")).length == 0 88 105 STDERR.puts "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" … … 95 112 task :hpricot_scan => [:ragel] 96 113 97 desc "Builds just the #{extension} extension"98 task extension.to_sym => ["#{ext}/Makefile", ext_so ]99 100 file "#{ext}/Makefile" => ["#{ext}/extconf.rb"] do101 Dir.chdir(ext) do ruby "extconf.rb" end102 end103 104 file ext_so => ext_files do105 Dir.chdir(ext) do106 sh(PLATFORM =~ /win32/ ? 'nmake' : 'make')107 end108 mkdir_p ARCHLIB109 cp ext_so, ARCHLIB110 end111 112 114 desc "returns the ragel version" 113 115 task :ragel_version do … … 129 131 Win32Spec = SPEC.dup 130 132 Win32Spec.platform = Gem::Platform::WIN32 131 Win32Spec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.so" ]133 Win32Spec.files = PKG_FILES + ["#{ARCHLIB}/hpricot_scan.so", "#{ARCHLIB}/fast_xs.so"] 132 134 Win32Spec.extensions = [] 133 135
