[前][次][番号順一覧][スレッド一覧]

ruby-changes:58644

From: Nobuyoshi <ko1@a...>
Date: Fri, 8 Nov 2019 16:33:26 +0900 (JST)
Subject: [ruby-changes:58644] 20971799f2 (master): Renamed `load_*.inc` as `*.rbinc` to utilize a suffix rule

https://git.ruby-lang.org/ruby.git/commit/?id=20971799f2

From 20971799f26c6466f63ab179ce2d3384155b9760 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Fri, 8 Nov 2019 16:24:24 +0900
Subject: Renamed `load_*.inc` as `*.rbinc` to utilize a suffix rule


diff --git a/ast.c b/ast.c
index 21ea11e..236560b 100644
--- a/ast.c
+++ b/ast.c
@@ -681,7 +681,7 @@ ast_node_inspect(rb_execution_context_t *ec, VALUE self) https://github.com/ruby/ruby/blob/trunk/ast.c#L681
     return str;
 }
 
-#include "load_ast.inc"
+#include "ast.rbinc"
 
 void
 Init_ast(void)
diff --git a/common.mk b/common.mk
index 70416e9..fcb0a91 100644
--- a/common.mk
+++ b/common.mk
@@ -4,7 +4,7 @@ bin: $(PROGRAM) $(WPROGRAM) https://github.com/ruby/ruby/blob/trunk/common.mk#L4
 lib: $(LIBRUBY)
 dll: $(LIBRUBY_SO)
 
-.SUFFIXES: .inc .h .c .y .i .$(ASMEXT) .$(DTRACE_EXT)
+.SUFFIXES: .rbinc .rb .inc .h .c .y .i .$(ASMEXT) .$(DTRACE_EXT)
 
 # V=0 quiet, V=1 verbose.  other values don't work.
 V = 0
@@ -614,7 +614,7 @@ clean-rubyspec: clean-spec https://github.com/ruby/ruby/blob/trunk/common.mk#L614
 
 distclean: distclean-ext distclean-enc distclean-golf distclean-docs distclean-extout distclean-local distclean-platform distclean-spec
 distclean-local:: clean-local
-	$(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(PRELUDES)
+	$(Q)$(RM) $(MKFILES) yasmdata.rb *.inc $(PRELUDES) *.rbinc
 	$(Q)$(RM) config.cache config.status config.status.lineno
 	$(Q)$(RM) *~ *.bak *.stackdump core *.core gmon.out $(PREP)
 	-$(Q)$(RMALL) $(srcdir)/autom4te.cache
@@ -1094,22 +1094,16 @@ preludes: {$(VPATH)}prelude.c https://github.com/ruby/ruby/blob/trunk/common.mk#L1094
 preludes: {$(VPATH)}miniprelude.c
 preludes: {$(srcdir)}golf_prelude.c
 
-BUILTIN_RB_SRCS = $(srcdir)/trace_point.rb $(srcdir)/ast.rb $(srcdir)/io.rb
+BUILTIN_RB_SRCS = {$(VPATH)}trace_point.rb {$(VPATH)}ast.rb {$(VPATH)}io.rb
+BUILTIN_RB_INCS = $(BUILTIN_RB_SRCS:.rb=.rbinc)
+
+.rb.rbinc:
+	$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $<
 
 builtin_binary.inc: $(PREP) $(BUILTIN_RB_SRCS) $(srcdir)/tool/mk_builtin_binary.rb
 	$(Q) $(MINIRUBY) $(srcdir)/tool/mk_builtin_binary.rb
 
-load_trace_point.inc: $(srcdir)/trace_point.rb $(srcdir)/tool/mk_builtin_loader.rb
-	$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $(srcdir)/trace_point.rb
-
-load_ast.inc: $(srcdir)/ast.rb $(srcdir)/tool/mk_builtin_loader.rb
-	$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $(srcdir)/ast.rb
-
-load_io.inc: $(srcdir)/io.rb $(srcdir)/tool/mk_builtin_loader.rb
-	$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $(srcdir)/io.rb
-
-load_gc.inc: $(srcdir)/gc.rb $(srcdir)/tool/mk_builtin_loader.rb
-	$(Q) $(BASERUBY) $(srcdir)/tool/mk_builtin_loader.rb $(srcdir)/gc.rb
+$(BUILTIN_RB_INCS): $(top_srcdir)/tool/mk_builtin_loader.rb
 
 $(srcdir)/revision.h:
 	$(Q)$(gnumake:yes=#) $(RM) $(@F)
@@ -1598,7 +1592,7 @@ ast.$(OBJEXT): {$(VPATH)}id.h https://github.com/ruby/ruby/blob/trunk/common.mk#L1592
 ast.$(OBJEXT): {$(VPATH)}intern.h
 ast.$(OBJEXT): {$(VPATH)}internal.h
 ast.$(OBJEXT): {$(VPATH)}iseq.h
-ast.$(OBJEXT): {$(VPATH)}load_ast.inc
+ast.$(OBJEXT): {$(VPATH)}ast.rbinc
 ast.$(OBJEXT): {$(VPATH)}method.h
 ast.$(OBJEXT): {$(VPATH)}missing.h
 ast.$(OBJEXT): {$(VPATH)}node.h
@@ -2108,7 +2102,7 @@ gc.$(OBJEXT): {$(VPATH)}id_table.h https://github.com/ruby/ruby/blob/trunk/common.mk#L2102
 gc.$(OBJEXT): {$(VPATH)}intern.h
 gc.$(OBJEXT): {$(VPATH)}internal.h
 gc.$(OBJEXT): {$(VPATH)}io.h
-gc.$(OBJEXT): {$(VPATH)}load_gc.inc
+gc.$(OBJEXT): {$(VPATH)}gc.rbinc
 gc.$(OBJEXT): {$(VPATH)}method.h
 gc.$(OBJEXT): {$(VPATH)}missing.h
 gc.$(OBJEXT): {$(VPATH)}mjit.h
@@ -2236,7 +2230,7 @@ io.$(OBJEXT): {$(VPATH)}intern.h https://github.com/ruby/ruby/blob/trunk/common.mk#L2230
 io.$(OBJEXT): {$(VPATH)}internal.h
 io.$(OBJEXT): {$(VPATH)}io.c
 io.$(OBJEXT): {$(VPATH)}io.h
-io.$(OBJEXT): {$(VPATH)}load_io.inc
+io.$(OBJEXT): {$(VPATH)}io.rbinc
 io.$(OBJEXT): {$(VPATH)}method.h
 io.$(OBJEXT): {$(VPATH)}missing.h
 io.$(OBJEXT): {$(VPATH)}node.h
@@ -3419,7 +3413,7 @@ vm_trace.$(OBJEXT): {$(VPATH)}intern.h https://github.com/ruby/ruby/blob/trunk/common.mk#L3413
 vm_trace.$(OBJEXT): {$(VPATH)}internal.h
 vm_trace.$(OBJEXT): {$(VPATH)}io.h
 vm_trace.$(OBJEXT): {$(VPATH)}iseq.h
-vm_trace.$(OBJEXT): {$(VPATH)}load_trace_point.inc
+vm_trace.$(OBJEXT): {$(VPATH)}trace_point.rbinc
 vm_trace.$(OBJEXT): {$(VPATH)}method.h
 vm_trace.$(OBJEXT): {$(VPATH)}missing.h
 vm_trace.$(OBJEXT): {$(VPATH)}mjit.h
diff --git a/gc.c b/gc.c
index 06d9fee..7fd80a3 100644
--- a/gc.c
+++ b/gc.c
@@ -11801,7 +11801,7 @@ rb_gcdebug_remove_stress_to_class(int argc, VALUE *argv, VALUE self) https://github.com/ruby/ruby/blob/trunk/gc.c#L11801
  *  See also GC.count, GC.malloc_allocated_size and GC.malloc_allocations
  */
 
-#include "load_gc.inc"
+#include "gc.rbinc"
 
 void
 Init_GC(void)
diff --git a/io.c b/io.c
index ada3300..5de3977 100644
--- a/io.c
+++ b/io.c
@@ -13523,7 +13523,7 @@ Init_IO(void) https://github.com/ruby/ruby/blob/trunk/io.c#L13523
     sym_wait_writable = ID2SYM(rb_intern("wait_writable"));
 }
 
-#include "load_io.inc"
+#include "io.rbinc"
 
 void
 Init_IO_nonblock(void)
diff --git a/tool/mk_builtin_loader.rb b/tool/mk_builtin_loader.rb
index dafab79f..aa8e46d 100644
--- a/tool/mk_builtin_loader.rb
+++ b/tool/mk_builtin_loader.rb
@@ -26,12 +26,12 @@ def collect_builtin iseq_ary, bs https://github.com/ruby/ruby/blob/trunk/tool/mk_builtin_loader.rb#L26
   }
 end
 # ruby mk_builtin_loader.rb TARGET_FILE.rb
-# #=> generate load_TARGET_FILE.inc
+# #=> generate TARGET_FILE.rbinc
 #
 
 def mk_builtin_header file
   base = File.basename(file, '.rb')
-  ofile = File.join("load_#{base}.inc")
+  ofile = "#{base}.rbinc"
 
   collect_builtin(RubyVM::InstructionSequence.compile_file(file, false).to_a, bs = {})
 
diff --git a/vm_trace.c b/vm_trace.c
index 1cb5fd0..9a60481 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -1511,7 +1511,7 @@ tracepoint_stat_s(rb_execution_context_t *ec, VALUE self) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1511
     return stat;
 }
 
-#include "load_trace_point.inc"
+#include "trace_point.rbinc"
 
 /* This function is called from inits.c */
 void
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]