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

mkmf.rb: separate timestamp files

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

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2016-08-31 02:41:31 +00:00
parent d484b0a3b8
commit 506b45db9c
2 changed files with 15 additions and 10 deletions

View file

@ -210,7 +210,7 @@ showconfig:
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
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):
$(Q) $(MAKEDIRS) enc/trans $(@D)
@exit > $@
$(TIMESTAMPDIR)/.$(arch).time:
$(Q)$(MAKEDIRS) $(@D) $(TIMESTAMPDIR)/$(arch)
@exit > $@
###
CCAN_DIR = {$(VPATH)}ccan

View file

@ -2028,15 +2028,16 @@ preload = #{defined?($preload) && $preload ? $preload.join(' ') : ''}
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: