[前][次][番号順一覧][スレッド一覧]

ruby-changes:37282

From: nobu <ko1@a...>
Date: Wed, 21 Jan 2015 13:22:22 +0900 (JST)
Subject: [ruby-changes:37282] nobu:r49363 (trunk): extmk.rb: extract CLEANFILES and DISTCLEANFILES

nobu	2015-01-21 13:22:07 +0900 (Wed, 21 Jan 2015)

  New Revision: 49363

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49363

  Log:
    extmk.rb: extract CLEANFILES and DISTCLEANFILES
    
    * ext/extmk.rb (extract_makefile): extract CLEANFILES and
      DISTCLEANFILES regardless previous configration succeeded, as
      ext/tk/extconf.rb makes config_list file always.

  Modified files:
    trunk/ext/extmk.rb
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 49362)
+++ ext/extmk.rb	(revision 49363)
@@ -83,6 +83,8 @@ end https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L83
 
 def extract_makefile(makefile, keep = true)
   m = File.read(makefile)
+  s = m[/^CLEANFILES[ \t]*=[ \t](.*)/, 1] and $cleanfiles = s.split
+  s = m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] and $distcleanfiles = s.split
   if !(target = m[/^TARGET[ \t]*=[ \t]*(\S*)/, 1])
     return keep
   end
@@ -127,7 +129,6 @@ def extract_makefile(makefile, keep = tr https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L129
   end
   $objs = (m[/^OBJS[ \t]*=[ \t](.*)/, 1] || "").split
   $srcs = (m[/^SRCS[ \t]*=[ \t](.*)/, 1] || "").split
-  $distcleanfiles = (m[/^DISTCLEANFILES[ \t]*=[ \t](.*)/, 1] || "").split
   $LOCAL_LIBS = m[/^LOCAL_LIBS[ \t]*=[ \t]*(.*)/, 1] || ""
   $LIBPATH = Shellwords.shellwords(m[/^libpath[ \t]*=[ \t]*(.*)/, 1] || "") - %w[$(libdir) $(topdir)]
   true
@@ -201,7 +202,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L202
 	$extconf_h = nil
 	ok &&= extract_makefile(makefile)
 	old_objs = $objs
-	old_cleanfiles = $distcleanfiles
+	old_cleanfiles = $distcleanfiles | $cleanfiles
 	conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
 	if (!ok || ($extconf_h && !File.exist?($extconf_h)) ||
 	    !(t = modified?(makefile, MTIMES)) ||
@@ -274,7 +275,7 @@ def extmake(target) https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L275
       args += ["static"] unless $clean
       $extlist.push [$static, target, $target, $preload]
     end
-    FileUtils.rm_f(old_cleanfiles - $distcleanfiles)
+    FileUtils.rm_f(old_cleanfiles - $distcleanfiles - $cleanfiles)
     FileUtils.rm_f(old_objs - $objs)
     unless $configure_only or system($make, *args)
       $ignore or $continue or return false

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]