Merge pull request #5437 from dearblue/parse.y

Run the task only once when `parse.y` is updated
This commit is contained in:
Yukihiro "Matz" Matsumoto
2021-11-06 19:58:28 +09:00
committed by GitHub
+5 -2
View File
@@ -12,18 +12,21 @@ MRuby::Gem::Specification.new 'mruby-compiler' do |spec|
end
end
build.libmruby_core_objs << objs
end
if MRuby::Build.current.name == "host"
dir = __dir__
lex_def = "#{dir}/core/lex.def"
# Parser
file "#{dir}/core/y.tab.c" => ["#{dir}/core/parse.y", lex_def] do |t|
yacc.run t.name, t.prerequisites.first
MRuby.targets["host"].yacc.run t.name, t.prerequisites.first
replace_line_directive(t.name)
end
# Lexical analyzer
file lex_def => "#{dir}/core/keywords" do |t|
gperf.run t.name, t.prerequisites.first
MRuby.targets["host"].gperf.run t.name, t.prerequisites.first
replace_line_directive(t.name)
end