Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add a rake task to precompile anything the compiler/parser needs

  • Loading branch information...
commit 7fccab8b8d258c57c27a96cae61e0fd9f4917553 1 parent 2edcd15
@wilson wilson authored
Showing with 14 additions and 2 deletions.
  1. +9 −1 Rakefile
  2. +5 −1 rakelib/kernel.rake
View
10 Rakefile
@@ -103,15 +103,23 @@ desc "Build everything that needs to be built"
task :build => %w[
vm
kernel:build
+ build:compiler
]
# build:rbc
-# compiler
# lib/etc.rb
# lib/rbconfig.rb
# extensions
namespace :build do
+ task :compiler do
+ files = Dir["lib/compiler/**/*.rb"]
+ files.concat %w(lib/strscan.rb lib/stringio.rb lib/racc/parser.rb)
+ files.each do |path|
+ compile_ruby path, "#{path}c", true
+ end
+ end
+
# task :setup_rbc => :stable_compiler
# task :rbc => ([:setup_rbc] + AllPreCompiled)
View
6 rakelib/kernel.rake
@@ -74,7 +74,11 @@ def create_load_order(files, output=".load_order.txt")
end
end
-def compile_ruby(src, rbc)
+def compile_ruby(src, rbc, check_mtime = false)
+ if check_mtime and File.readable?(rbc)
+ return if File.mtime(rbc) >= File.mtime(src)
+ end
+
dir = File.dirname rbc
FileUtils.mkdir_p dir unless File.directory? dir
Please sign in to comment.
Something went wrong with that request. Please try again.