summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-19 05:29:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-01-19 05:29:18 +0000
commite07bce5e5c217520629b96a55dec65c809eaeeda (patch)
tree66443a34cb80f93e9a75224de0c313afcd27ba92
parent040fef9a89b8da5cdc2e263eb5d94806a8058b83 (diff)
* Makefile.in (clean-ext): allow glob patterns.
* ext/extmk.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.in17
-rw-r--r--ext/extmk.rb40
3 files changed, 37 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index 545ed7d516..d23261de82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan 19 14:29:16 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * Makefile.in (clean-ext): allow glob patterns.
+
+ * ext/extmk.rb: ditto.
+
Mon Jan 18 17:16:03 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/webrick/httpservlet/filehandler.rb (make_partial_content):
diff --git a/Makefile.in b/Makefile.in
index d4a2359d28..9e1df06bbd 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -178,11 +178,18 @@ distclean-local::
-$(RM) $(INSTALLED_LIST)
clean-ext distclean-ext realclean-ext::
- @find ext -name Makefile | sort | while read mk; do \
- dir=`dirname "$$mk"`; \
- echo $(@:-ext=)ing `expr "$$dir" : 'ext/\(.*\)'`; \
- (cd "$$dir"; $(MAKE) $(MFLAGS) $(@:-ext=)) && \
- test $@ = clean-ext || rmdir -p "$$dir" 2> /dev/null; \
+ @cd ext; set dummy `echo "${EXTS}" | tr , ' '`; shift; \
+ test "$$#" = 0 && set .; \
+ set dummy `for dir; do \
+ find $$dir -name Makefile | sed 's:^\./::;s:/Makefile$$:~:' | sort | sed 's:~$$::'; \
+ done`; shift; \
+ for dir; do \
+ echo $(@:-ext=)ing "$$dir"; \
+ (cd "$$dir" && exec $(MAKE) $(MFLAGS) $(@:-ext=)) && \
+ case "$@" in \
+ *distclean-ext*|*realclean-ext*) \
+ rmdir -p "$$dir" 2> /dev/null;; \
+ esac; \
done
ext/extinit.$(OBJEXT): ext/extinit.c $(SETUP)
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 05d3e78dbc..96b6fefdf1 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -397,29 +397,27 @@ end unless $extstatic
ext_prefix = "#{$top_srcdir}/ext"
exts = $static_ext.sort_by {|t, i| i}.collect {|t, i| t}
-if $extension
- exts |= $extension.select {|d| File.directory?("#{ext_prefix}/#{d}")}
-else
- withes, withouts = %w[--with --without].collect {|w|
- if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
- nil
- elsif (w = w.grep(String)).empty?
- proc {true}
- else
- proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)}
- end
- }
- if withes
- withouts ||= proc {true}
+withes, withouts = %w[--with --without].collect {|w|
+ if not (w = %w[-extensions -ext].collect {|o|arg_config(w+o)}).any?
+ nil
+ elsif (w = w.grep(String)).empty?
+ proc {true}
else
- withes = proc {false}
- withouts ||= withes
+ proc {|c1| w.collect {|o| o.split(/,/)}.flatten.any?(&c1)}
end
- cond = proc {|ext, *|
- cond1 = proc {|n| File.fnmatch(n, ext)}
- withes.call(cond1) or !withouts.call(cond1)
- }
- exts |= Dir.glob("#{ext_prefix}/*/**/extconf.rb").collect {|d|
+}
+if withes
+ withouts ||= proc {true}
+else
+ withes = proc {false}
+ withouts ||= withes
+end
+cond = proc {|ext, *|
+ cond1 = proc {|n| File.fnmatch(n, ext)}
+ withes.call(cond1) or !withouts.call(cond1)
+}
+($extension || %w[*]).each do |e|
+ exts |= Dir.glob("#{ext_prefix}/#{e}/**/extconf.rb").collect {|d|
d = File.dirname(d)
d.slice!(0, ext_prefix.length + 1)
d