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

ruby-changes:43973

From: nobu <ko1@a...>
Date: Wed, 31 Aug 2016 11:41:40 +0900 (JST)
Subject: [ruby-changes:43973] nobu:r56046 (trunk): mkmf.rb: separate timestamp files

nobu	2016-08-31 11:41:31 +0900 (Wed, 31 Aug 2016)

  New Revision: 56046

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56046

  Log:
    mkmf.rb: separate timestamp files
    
    * lib/mkmf.rb (timestamp_file): separate timestamp files for each
      architectures.

  Modified files:
    trunk/common.mk
    trunk/lib/mkmf.rb
Index: common.mk
===================================================================
--- common.mk	(revision 56045)
+++ common.mk	(revision 56046)
@@ -210,7 +210,7 @@ showconfig: https://github.com/ruby/ruby/blob/trunk/common.mk#L210
 exts: build-ext
 
 EXTS_MK = exts.mk
-$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY)
+$(EXTS_MK): $(MKFILES) all-incs $(PREP) $(RBCONFIG) $(LIBRUBY) $(TIMESTAMPDIR)/.$(arch).time
 	$(ECHO) generating makefile $@
 	$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$(EXTS_MK) $(EXTMK_ARGS) configure
 
@@ -544,8 +544,8 @@ realclean-extout: distclean-extout https://github.com/ruby/ruby/blob/trunk/common.mk#L544
 
 clean-ext distclean-ext realclean-ext::
 	$(Q)$(RM) $(EXTS_MK)
-	$(Q)$(RM) $(EXTOUT)/.timestamp/.*.time
-	$(Q)$(RMDIR) $(EXTOUT)/.timestamp 2> $(NULL) || exit 0
+	$(Q)$(RM) $(TIMESTAMPDIR)/.*.time $(TIMESTAMPDIR)/.$(arch).time $(TIMESTAMPDIR)/$(arch)/.time
+	$(Q)$(RMDIR) $(TIMESTAMPDIR)/$(arch) $(TIMESTAMPDIR) 2> $(NULL) || exit 0
 
 clean-enc distclean-enc realclean-enc: PHONY
 
@@ -716,6 +716,10 @@ $(ENC_TRANS_D): https://github.com/ruby/ruby/blob/trunk/common.mk#L716
 	$(Q) $(MAKEDIRS) enc/trans $(@D)
 	@exit > $@
 
+$(TIMESTAMPDIR)/.$(arch).time:
+	$(Q)$(MAKEDIRS) $(@D) $(TIMESTAMPDIR)/$(arch)
+	@exit > $@
+
 ###
 CCAN_DIR = {$(VPATH)}ccan
 
Index: lib/mkmf.rb
===================================================================
--- lib/mkmf.rb	(revision 56045)
+++ lib/mkmf.rb	(revision 56046)
@@ -2028,15 +2028,16 @@ preload = #{defined?($preload) && $prelo https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2028
   end
 
   def timestamp_file(name, target_prefix = nil)
-    if target_prefix
-      pat = []
-      install_dirs.each do |n, d|
-        pat << n if /\$\(target_prefix\)\z/ =~ d
-      end
-      name = name.gsub(/\$\((#{pat.join("|")})\)/) {$&+target_prefix}
+    pat = {}
+    install_dirs.each do |n, d|
+      pat[n] = $` if /\$\(target_prefix\)\z/ =~ d
     end
+    name = name.gsub(/\$\((#{pat.keys.join("|")})\)/) {pat[$1]+target_prefix}
+    name.sub!(/\A\$\(extout\)\//, '')
+    name.sub!(/(\$\((?:site)?arch\))\/*/, '')
+    arch = $1 || ''
     name = name.gsub(/(\$[({]|[})])|(\/+)|[^-.\w]+/) {$1 ? "" : $2 ? ".-." : "_"}
-    "$(TIMESTAMP_DIR)/.#{name}.time"
+    File.join("$(TIMESTAMP_DIR)", arch, "#{name.sub(/\A(?=.)/, '.')}.time")
   end
   # :startdoc:
 

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

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