Fix dependencies.

parent e050cfb3
......@@ -19,9 +19,10 @@ MRuby.each_target do
mruby_config_path = "#{build_dir}/bin/#{mruby_config}"
@bins << mruby_config
file mruby_config_path => libfile("#{build_dir}/lib/libmruby") do |t|
make_cfg = "#{build_dir}/lib/libmruby.flags.mak"
file mruby_config_path => [libfile("#{build_dir}/lib/libmruby"), make_cfg] do |t|
FileUtils.copy "#{File.dirname(__FILE__)}/#{mruby_config}", t.name
config = Hash[open("#{build_dir}/lib/libmruby.flags.mak").read.split("\n").map {|x| a = x.split(/\s*=\s*/, 2); [a[0], a[1].gsub('\\"', '"') ]}]
config = Hash[open(make_cfg).read.split("\n").map {|x| a = x.split(/\s*=\s*/, 2); [a[0], a[1].gsub('\\"', '"') ]}]
IO.write(t.name, File.open(t.name) {|f|
f.read.gsub (/echo (MRUBY_CFLAGS|MRUBY_LIBS|MRUBY_LDFLAGS_BEFORE_LIBS|MRUBY_LDFLAGS|MRUBY_LIBMRUBY_PATH)/) {|x| config[$1].empty? ? '' : "echo #{config[$1]}"}
})
......
......@@ -23,10 +23,9 @@ MRuby::Gem::Specification.new 'mruby-compiler' do |spec|
cc.run t.name, t.prerequisites.first, [], ["#{current_dir}/core"]
end
end
file objfile("#{current_build_dir}/core/y.tab") => lex_def
# Parser
file "#{current_build_dir}/core/y.tab.c" => ["#{current_dir}/core/parse.y"] do |t|
file "#{current_build_dir}/core/y.tab.c" => ["#{current_dir}/core/parse.y", lex_def] do |t|
FileUtils.mkdir_p File.dirname t.name
yacc.run t.name, t.prerequisites.first
end
......
......@@ -31,7 +31,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
mrbtest_objs << assert_lib
file assert_lib => assert_c
file assert_c => assert_rb do |t|
file assert_c => [assert_rb, build.mrbcfile] do |t|
open(t.name, 'w') do |f|
mrbc.run f, assert_rb, 'mrbtest_assert_irep'
end
......@@ -45,7 +45,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
dep_list = build.gems.tsort_dependencies(g.test_dependencies, gem_table).select(&:generate_functions)
file test_rbobj => g.test_rbireps
file g.test_rbireps => [g.test_rbfiles].flatten do |t|
file g.test_rbireps => [g.test_rbfiles, build.mrbcfile].flatten do |t|
FileUtils.mkdir_p File.dirname(t.name)
open(t.name, 'w') do |f|
g.print_gem_test_header(f)
......@@ -169,7 +169,7 @@ MRuby::Gem::Specification.new('mruby-test') do |spec|
file clib => active_gems_path
file mlib => clib
file clib => init do |t|
file clib => [init, build.mrbcfile] do |t|
_pp "GEN", "*.rb", "#{clib.relative_path}"
FileUtils.mkdir_p File.dirname(clib)
open(clib, 'w') do |f|
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment