From 82a2a5657c1023cbad15db6eec4f85aba594a41e Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Tue, 3 Nov 2020 16:03:46 +0900 Subject: Reduce recompilation when updating presym target files Fix that updating presym target files would recompile almost all files even if symbols did not change. --- Rakefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 272aad011..2d88cde99 100644 --- a/Rakefile +++ b/Rakefile @@ -115,6 +115,7 @@ psfiles.each do |file| end symbols.each{|x| x.chomp!} presym_file="#{MRUBY_ROOT}/build/presym" +presym_inc="#{presym_file}.inc" op_table = { "!" => "not", "!=" => "neq", @@ -189,11 +190,11 @@ file presym_file => cfiles+rbfiles+psfiles+[__FILE__] do presyms.each{|x| x.chomp!} if presyms != symbols File.write(presym_file, symbols.join("\n")) + Rake::Task[presym_inc].invoke end end -presym_inc=presym_file+".inc" -file presym_inc => presym_file do +task presym_inc do presyms = File.readlines(presym_file) presyms.each{|x| x.chomp!} File.open(presym_inc, "w") do |f| @@ -231,7 +232,7 @@ file presym_inc => presym_file do end desc "preallocated symbols" -task :gensym => presym_inc +task :gensym => presym_file depfiles += MRuby.targets.map { |n, t| t.libraries -- cgit v1.2.3