diff --git a/template/Makefile.in b/template/Makefile.in index 5c2f81381e..06878d552f 100644 --- a/template/Makefile.in +++ b/template/Makefile.in @@ -505,7 +505,7 @@ clean-local:: -$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD) main: $(srcdir)/lib/mjit/instruction.rb -$(srcdir)/lib/mjit/instruction.rb: $(tooldir)/ruby_vm/views/lib/mjit/instruction.rb.erb $(srcdir)/insns.def +$(srcdir)/lib/mjit/instruction.rb: $(tooldir)/ruby_vm/views/instruction.rb.erb $(srcdir)/insns.def $(ECHO) generating $@ $(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@ diff --git a/tool/ruby_vm/helpers/dumper.rb b/tool/ruby_vm/helpers/dumper.rb index c4294e1b3e..7aec9c7631 100644 --- a/tool/ruby_vm/helpers/dumper.rb +++ b/tool/ruby_vm/helpers/dumper.rb @@ -25,11 +25,10 @@ class RubyVM::Dumper end def new_erb spec - srcdir = Pathname.new(__dir__).parent.parent.parent path = Pathname.new(__FILE__) path = (path.relative_path_from(Pathname.pwd) rescue path).dirname path += '../views' - path += Pathname.pwd.join(spec).to_s.sub("#{srcdir}/", '') + path += File.basename(spec) src = path.read mode: 'rt:utf-8:utf-8' rescue Errno::ENOENT raise "don't know how to generate #{path}" diff --git a/tool/ruby_vm/views/lib/mjit/instruction.rb.erb b/tool/ruby_vm/views/instruction.rb.erb similarity index 100% rename from tool/ruby_vm/views/lib/mjit/instruction.rb.erb rename to tool/ruby_vm/views/instruction.rb.erb