aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-20 14:22:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-20 14:22:44 +0000
commitc2c6687ddb5b8531ac71f816c3b769ea68cb154a (patch)
tree5a4c2d49a8779e7ec97d7aa62eabac6077eee7af /lib
parentaa347ba042d6a1adf27d9ef139be9436634b9ce8 (diff)
downloadruby-c2c6687ddb5b8531ac71f816c3b769ea68cb154a.tar.gz
* ext/extmk.rb (extract_makefile, extmake): regenerate makefiels
if globbed source file list is changed. * lib/mkmf.rb (create_makefile): store ORIG_SRCS. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/mkmf.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index a3dcadb9ef..a0779237f8 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1924,8 +1924,9 @@ def create_makefile(target, srcprefix = nil)
RbConfig.expand(srcdir = srcprefix.dup)
ext = ".#{$OBJEXT}"
+ orig_srcs = Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
if not $objs
- srcs = $srcs || Dir[File.join(srcdir, "*.{#{SRC_EXT.join(%q{,})}}")]
+ srcs = $srcs || orig_srcs
objs = srcs.inject(Hash.new {[]}) {|h, f| h[File.basename(f, ".*") << ext] <<= f; h}
$objs = objs.keys
unless objs.delete_if {|b, f| f.size == 1}.empty?
@@ -1990,7 +1991,8 @@ extout_prefix = #{$extout_prefix}
target_prefix = #{target_prefix}
LOCAL_LIBS = #{$LOCAL_LIBS}
LIBS = #{$LIBRUBYARG} #{$libs} #{$LIBS}
-SRCS = #{srcs.collect(&File.method(:basename)).join(' ')}
+ORIG_SRCS = #{orig_srcs.collect(&File.method(:basename)).join(' ')}
+SRCS = $(ORIG_SRCS) #{(srcs - orig_srcs).collect(&File.method(:basename)).join(' ')}
OBJS = #{$objs.join(" ")}
TARGET = #{target}
DLLIB = #{dllib}