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:
parent
c9f982d4e8
commit
b0e7ec8c9a
@ -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>
|
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
|
* ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods to
|
||||||
|
@ -222,14 +222,14 @@ def extmake(target)
|
|||||||
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
|
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
|
||||||
ok = yield(ok) if block_given?
|
ok = yield(ok) if block_given?
|
||||||
if ok
|
if ok
|
||||||
open(makefile, "r+") do |f|
|
open(makefile, "r+b") do |f|
|
||||||
s = f.read.sub!(/^(static:)\s.*/, '\1 all')
|
s = f.read.sub!(/^(static:)\s(?!all\b).*/, '\1 all') or break
|
||||||
f.rewind
|
f.rewind
|
||||||
f.print(s)
|
f.print(s)
|
||||||
f.truncate(f.pos)
|
f.truncate(f.pos)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
open(makefile, "w") do |f|
|
open(makefile, "wb") do |f|
|
||||||
f.puts "# " + DUMMY_SIGNATURE
|
f.puts "# " + DUMMY_SIGNATURE
|
||||||
f.print(*dummy_makefile(CONFIG["srcdir"]))
|
f.print(*dummy_makefile(CONFIG["srcdir"]))
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user