diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-03 08:10:10 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-03 08:10:10 +0000 |
| commit | 94c805728533b0ebf9343a51f87491de99e98617 (patch) | |
| tree | 3b6bee38619002b3daf5ada19ff0cf1aeb31bf70 /ext | |
| parent | fd1655d5a909339923840f76e26d803d3af330cf (diff) | |
| download | ruby-94c805728533b0ebf9343a51f87491de99e98617.tar.gz ruby-94c805728533b0ebf9343a51f87491de99e98617.tar.xz ruby-94c805728533b0ebf9343a51f87491de99e98617.zip | |
* ext/extmk.rb (extmake): removes object files no longer used and
files to be removed by old distclean.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/extmk.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index 509c93e46..10cb05630 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -80,6 +80,7 @@ def extract_makefile(makefile, keep = true) 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 @@ -139,6 +140,7 @@ def extmake(target) $extconf_h = nil ok &&= extract_makefile(makefile) old_objs = $objs + old_cleanfiles = $distcleanfiles conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)} if (($extconf_h && !File.exist?($extconf_h)) || !(t = modified?(makefile, MTIMES)) || @@ -179,7 +181,8 @@ def extmake(target) args += ["static"] unless $clean $extlist.push [$static, $target, File.basename($target), $preload] end - FileUtils.rm_f($objs - old_objs) + FileUtils.rm_f(old_cleanfiles - $distcleanfiles) + FileUtils.rm_f(old_objs - $objs) unless system($make, *args) $ignore or $continue or return false end |
