Preserve the directory structure under tool/ruby_vm/views
for nested target directories
This commit is contained in:
parent
0e816e6d30
commit
62ec621f8c
@ -505,7 +505,7 @@ clean-local::
|
|||||||
-$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)
|
-$(Q) $(RMDIRS) $(MJIT_HEADER_INSTALL_DIR) $(MJIT_HEADER_BUILD_DIR) $(TIMESTAMPDIR) 2> $(NULL) || $(NULLCMD)
|
||||||
|
|
||||||
main: $(srcdir)/lib/mjit/instruction.rb
|
main: $(srcdir)/lib/mjit/instruction.rb
|
||||||
$(srcdir)/lib/mjit/instruction.rb: $(tooldir)/ruby_vm/views/instruction.rb.erb $(srcdir)/insns.def
|
$(srcdir)/lib/mjit/instruction.rb: $(tooldir)/ruby_vm/views/lib/mjit/instruction.rb.erb $(srcdir)/insns.def
|
||||||
$(ECHO) generating $@
|
$(ECHO) generating $@
|
||||||
$(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@
|
$(Q) $(BASERUBY) -Ku $(tooldir)/insns2vm.rb $(INSNS2VMOPT) $@
|
||||||
|
|
||||||
|
@ -25,10 +25,11 @@ class RubyVM::Dumper
|
|||||||
end
|
end
|
||||||
|
|
||||||
def new_erb spec
|
def new_erb spec
|
||||||
|
srcdir = Pathname.new(__dir__).parent.parent.parent
|
||||||
path = Pathname.new(__FILE__)
|
path = Pathname.new(__FILE__)
|
||||||
path = (path.relative_path_from(Pathname.pwd) rescue path).dirname
|
path = (path.relative_path_from(Pathname.pwd) rescue path).dirname
|
||||||
path += '../views'
|
path += '../views'
|
||||||
path += File.basename(spec)
|
path += Pathname.pwd.join(spec).to_s.sub("#{srcdir}/", '')
|
||||||
src = path.read mode: 'rt:utf-8:utf-8'
|
src = path.read mode: 'rt:utf-8:utf-8'
|
||||||
rescue Errno::ENOENT
|
rescue Errno::ENOENT
|
||||||
raise "don't know how to generate #{path}"
|
raise "don't know how to generate #{path}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user