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

extmk.rb: untouch makefiles

* ext/extmk.rb (extmake): leave makefiles untouched if the content is
  not changed, to get rid of unnecessary re-linking.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2013-05-28 02:30:13 +00:00
parent c9f982d4e8
commit b0e7ec8c9a
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,8 @@
Tue May 28 11:30:02 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb (extmake): leave makefiles untouched if the content is
not changed, to get rid of unnecessary re-linking.
Tue May 28 03:11:02 2013 Koichi Sasada <ko1@atdot.net>
* ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to

View file

@ -222,14 +222,14 @@ def extmake(target)
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
ok = yield(ok) if block_given?
if ok
open(makefile, "r+") do |f|
s = f.read.sub!(/^(static:)\s.*/, '\1 all')
open(makefile, "r+b") do |f|
s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break
f.rewind
f.print(s)
f.truncate(f.pos)
end
else
open(makefile, "w") do |f|
open(makefile, "wb") do |f|
f.puts "# " + DUMMY_SIGNATURE
f.print(*dummy_makefile(CONFIG["srcdir"]))
end