diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/extmk.rb | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb index e4b62c8553..1c34fa0aa1 100644 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -297,9 +297,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/ @@ -427,7 +427,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 |