Skip to content

Commit

Permalink
* lib/mkmf.rb (create_makefile): add .SUFFIXES from depend file.
Browse files Browse the repository at this point in the history
  fixed: [ruby-dev:26294]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Jun 7, 2005
1 parent 15dfe8e commit f367837
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -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>

* parse.y (parser_yylex): allow ';;' to be block terminator in
Expand Down Expand Up @@ -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/gdbm/test_gdbm.rb: merged from ext/gdbm/testgdbm.rb.

* test/sdbm/test_sdbm.rb: renamed from ext/sdbm/testsdbm.rb with
modification to use test/unit.

Expand Down
11 changes: 9 additions & 2 deletions lib/mkmf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1110,11 +1110,13 @@ def create_makefile(target, srcprefix = nil)

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|
Expand All @@ -1127,12 +1129,13 @@ def create_makefile(target, srcprefix = nil)
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)") {|*m| RULE_SUBST % m}
end
mfile.print line
depout << line
end
while line = dfile.gets()
line.gsub!(/\.o\b/, ".#{$OBJEXT}")
Expand All @@ -1152,6 +1155,10 @@ def create_makefile(target, srcprefix = nil)
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
Expand Down

0 comments on commit f367837

Please sign in to comment.