1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* common.mk (prelude.o): depends on vm_core.h now.

* common.mk (prelude.c): depends on tool/compile_prelude.rb too.

* common.mk (prereq): updates all auto-generated sources.

* tool/compile_prelude.rb: separated dynamic and static portions.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2007-08-25 01:20:30 +00:00
parent c289cf3a1f
commit cfaf3d9a1a
3 changed files with 23 additions and 8 deletions

View file

@ -1,3 +1,13 @@
Sat Aug 25 10:20:28 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (prelude.o): depends on vm_core.h now.
* common.mk (prelude.c): depends on tool/compile_prelude.rb too.
* common.mk (prereq): updates all auto-generated sources.
* tool/compile_prelude.rb: separated dynamic and static portions.
Sat Aug 25 10:05:17 2007 Koichi Sasada <ko1@atdot.net>
* prelude.rb: add Thread.exclusive. This class method

View file

@ -589,7 +589,7 @@ blockinlining.$(OBJEXT): {$(VPATH)}blockinlining.c \
{$(VPATH)}debug.h {$(VPATH)}vm_opts.h \
{$(VPATH)}thread_$(THREAD_MODEL).h
id.$(OBJEXT): {$(VPATH)}id.c {$(VPATH)}ruby.h
prelude.$(OBJEXT): {$(VPATH)}prelude.c {$(VPATH)}ruby.h
prelude.$(OBJEXT): {$(VPATH)}prelude.c {$(VPATH)}ruby.h {$(VPATH)}vm_core.h
MATZRUBY = $(MATZRUBYDIR)ruby
@ -623,8 +623,10 @@ incs: $(INSNS) node_name.inc
node_name.inc: {$(VPATH)}node.h
$(BASERUBY) -n $(srcdir)/tool/node_name.rb $? > $@
prelude.c: {$(VPATH)}prelude.rb
$(BASERUBY) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb prelude.c
prelude.c: $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb
$(BASERUBY) $(srcdir)/tool/compile_prelude.rb $(srcdir)/prelude.rb $@
prereq: incs prelude.c
docs:
$(BASERUBY) -I$(srcdir) $(srcdir)/tool/makedocs.rb $(INSNS2VMOPT)

View file

@ -1,26 +1,29 @@
prelude, outfile = *ARGV
lines = []
lines = File.readlines(prelude).map{|line|
line.dump
}
open(outfile, 'w'){|f|
f.puts <<EOS__
f.puts <<EOS__, <<'EOS__'
#include "ruby/ruby.h"
#include "vm_core.h"
static const char *prelude_code =
static const char prelude_name[] = "#{File.basename(prelude)}";
static const char prelude_code[] =
#{lines.join("\n")}
;
EOS__
void
Init_prelude(void)
{
rb_iseq_eval(rb_iseq_compile(
rb_str_new2(prelude_code),
rb_str_new2("#{File.basename(prelude)}"), INT2FIX(1)));
rb_str_new(prelude_code, sizeof(prelude_code) - 1),
rb_str_new(prelude_name, sizeof(prelude_name) - 1),
INT2FIX(1)));
#if 0
printf("%s\n", prelude_code);