* lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.

fixed: [ruby-dev:26294]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2005-06-07 09:30:35 +00:00
Родитель 15dfe8eee6
Коммит f36783751b
2 изменённых файлов: 15 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Tue Jun 7 18:30:04 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
fixed: [ruby-dev:26294]
Tue Jun 7 17:20:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org> Tue Jun 7 17:20:39 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (parser_yylex): allow ';;' to be block terminator in * parse.y (parser_yylex): allow ';;' to be block terminator in
@ -45,7 +50,7 @@ Sat Jun 4 14:55:18 2005 Tanaka Akira <akr@m17n.org>
* test/dbm/test_dbm.rb: merged from ext/dbm/testdbm.rb. * test/dbm/test_dbm.rb: merged from ext/dbm/testdbm.rb.
* test/gdbm/test_gdbm.rb: merged from ext/gdbm/testgdbm.rb. * test/gdbm/test_gdbm.rb: merged from ext/gdbm/testgdbm.rb.
* test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with * test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with
modification to use test/unit. modification to use test/unit.

Просмотреть файл

@ -1110,11 +1110,13 @@ site-install-rb: install-rb
depend = File.join(srcdir, "depend") depend = File.join(srcdir, "depend")
if File.exist?(depend) if File.exist?(depend)
suffixes = []
depout = []
open(depend, "r") do |dfile| open(depend, "r") do |dfile|
mfile.printf "###\n" mfile.printf "###\n"
cont = implicit = nil cont = implicit = nil
impconv = proc do 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 implicit = nil
end end
ruleconv = proc do |line| ruleconv = proc do |line|
@ -1127,12 +1129,13 @@ site-install-rb: install-rb
end end
end end
if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line) if m = /\A\.(\w+)\.(\w+)(?:\s*:)/.match(line)
suffixes << m[1] << m[2]
implicit = [[m[1], m[2]], [m.post_match]] implicit = [[m[1], m[2]], [m.post_match]]
next next
elsif RULE_SUBST and /\A[$\w][^#]*:/ =~ line elsif RULE_SUBST and /\A[$\w][^#]*:/ =~ line
line.gsub!(%r"(?<=\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {|*m| RULE_SUBST % m} line.gsub!(%r"(?<=\s)(?!\.)([^$(){}+=:\s\/\\,]+)(?=\s|\z)") {|*m| RULE_SUBST % m}
end end
mfile.print line depout << line
end end
while line = dfile.gets() while line = dfile.gets()
line.gsub!(/\.o\b/, ".#{$OBJEXT}") line.gsub!(/\.o\b/, ".#{$OBJEXT}")
@ -1152,6 +1155,10 @@ site-install-rb: install-rb
impconv.call impconv.call
end end
end end
unless suffixes.empty?
mfile.print ".SUFFIXES: .", suffixes.uniq.join(" ."), "\n\n"
end
mfile.print depout
else else
headers = %w[ruby.h defines.h] headers = %w[ruby.h defines.h]
if RULE_SUBST if RULE_SUBST