Commit 66a55fb4 authored by dearblue's avatar dearblue

Run the task only once when `parse.y` is updated

Previously, the task was executed as many times as there were targets, including `mruby-compiler`.

```console
% rm mrbgems/mruby-compiler/core/y.tab.c
% rake `pwd`/mrbgems/mruby-compiler/core/y.tab.c
YACC  mrbgems/mruby-compiler/core/parse.y -> mrbgems/mruby-compiler/core/y.tab.c
YACC  mrbgems/mruby-compiler/core/parse.y -> mrbgems/mruby-compiler/core/y.tab.c
```
parent 8f362eaf
......@@ -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
......
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