From 5cf53bcb016926bb220e01e86ae37f97b07806d6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 15 Jun 2007 13:31:54 +0000 Subject: * common.mk (realclean): separate local and ext. * ext/extmk.rb: not remove unrelated directories. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/extmk.rb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'ext') diff --git a/ext/extmk.rb b/ext/extmk.rb index c3ba27aaf4..2ca605215a 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -294,9 +294,9 @@ parse_args() if target = ARGV.shift and /^[a-z-]+$/ =~ target $mflags.push(target) - target = target.sub(/^(dist|real)(?=(?:clean)?$)/, '') case target - when /clean/ + when /^(dist|real)?(clean)$/ + target = $2 $ignore ||= true $clean = $1 ? $1[0] : true when /^install\b/ @@ -421,7 +421,15 @@ if $ignore Dir.chdir ".." if $clean Dir.rmdir('ext') rescue nil - FileUtils.rm_rf(extout) if $extout + if $extout + FileUtils.rm_rf([extout+"/common", extout+"/include/ruby"]) + FileUtils.rm_rf(extout+"/"+CONFIG["arch"]) + if $clean != true + FileUtils.rm_rf(extout+"/include/"+CONFIG["arch"]) + Dir.rmdir(extout+"/include") rescue nil + Dir.rmdir(extout) rescue nil + end + end end exit end -- cgit v1.2.3