summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--common.mk5
-rw-r--r--ext/extmk.rb14
3 files changed, 21 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d46d1d..c6df015 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jun 15 22:33:29 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * common.mk (realclean): separate local and ext.
+
+ * ext/extmk.rb: not remove unrelated directories.
+
Fri Jun 15 17:01:20 2007 NAKAMURA Usaku <usa@ruby-lang.org>
* ext/dl/lib/dl/win32.rb: seems that dl doesn't accept void argument.
diff --git a/common.mk b/common.mk
index 71df932..db78c40 100644
--- a/common.mk
+++ b/common.mk
@@ -279,8 +279,11 @@ distclean-local:: clean-local
distclean-ext:
@-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) distclean
-realclean:: distclean
+realclean:: realclean-ext realclean-local
+realclean-local:: distclean-local
@$(RM) parse.c lex.c
+realclean-ext::
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS) realclean
check: test test-all
diff --git a/ext/extmk.rb b/ext/extmk.rb
index c3ba27a..2ca6052 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