diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-07 09:30:35 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-06-07 09:30:35 +0000 |
| commit | c189b3eed86e2d984ad058241cd177b667d931b7 (patch) | |
| tree | 34ec5b46e247d6756abe1129844aa35c88f6ae4e /lib | |
| parent | e0135c4f33b7d0e83a35a54540800433ef560d1d (diff) | |
| download | ruby-c189b3eed86e2d984ad058241cd177b667d931b7.tar.gz ruby-c189b3eed86e2d984ad058241cd177b667d931b7.tar.xz ruby-c189b3eed86e2d984ad058241cd177b667d931b7.zip | |
* lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
fixed: [ruby-dev:26294]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@8585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/mkmf.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 3c61eccbd..d5fa3e51c 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1104,11 +1104,13 @@ site-install-rb: install-rb depend = File.join(srcdir, "depend") if File.exist?(depend) + suffixes = [] + depout = [] open(depend, "r") do |dfile| mfile.printf "###\n" cont = implicit = nil impconv = proc do - COMPILE_RULES.each {|rule| mfile.print(rule % implicit[0], implicit[1])} + COMPILE_RULES.each {|rule| depout << (rule % implicit[0]) << implicit[1]} implicit = nil end ruleconv = proc do |line| @@ -1121,12 +1123,13 @@ site-install-rb: install-rb end end if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line) + suffixes << m[1] << m[2] implicit = [[m[1], m[2]], [m.post_match]] next elsif RULE_SUBST and /\A[$\w][^#]*:/ =~ line line.gsub!(%r"(\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {$1 + RULE_SUBST % $2} end - mfile.print line + depout << line end while line = dfile.gets() line.gsub!(/\.o\b/, ".#{$OBJEXT}") @@ -1146,6 +1149,10 @@ site-install-rb: install-rb impconv.call end end + unless suffixes.empty? + mfile.print ".SUFFIXES: .", suffixes.uniq.join(" ."), "\n\n" + end + mfile.print depout else headers = %w[ruby.h defines.h] if RULE_SUBST |
