summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-30 10:16:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-30 10:16:53 +0000
commitfb0b931709d92ccfe3ac1bfe2f883cf36eda9e20 (patch)
tree0426b7cbae13dc413203200a97f253cd59c645c2
parent20d146389cd347cf51a7ba5ab8f1795985357a3a (diff)
* ext/extmk.rb: split --make argument contains options, assume
the first word of --make-flags is always options even unless preceeded by -, and ignore letter-case of options if nmake. * instruby.rb: extract -n option also from --make and --make-flags. * bcc32/Makefile.sub, win32/Makefile.sub: not prepend - to $(MFLAGS) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog12
-rw-r--r--bcc32/Makefile.sub10
-rw-r--r--ext/extmk.rb3
-rw-r--r--instruby.rb10
-rw-r--r--win32/Makefile.sub10
5 files changed, 32 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 30a3092a0b..0de71a3fc4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+Mon Dec 30 19:10:30 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * ext/extmk.rb: split --make argument contains options, assume
+ the first word of --make-flags is always options even unless
+ preceeded by -, and ignore letter-case of options if nmake.
+
+ * instruby.rb: extract -n option also from --make and
+ --make-flags.
+
+ * bcc32/Makefile.sub, win32/Makefile.sub: not prepend - to
+ $(MFLAGS)
+
Mon Dec 30 16:44:14 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* string.c (rb_str_substr): should share the shared string if
diff --git a/bcc32/Makefile.sub b/bcc32/Makefile.sub
index 0640a7ff71..b7ffb11502 100644
--- a/bcc32/Makefile.sub
+++ b/bcc32/Makefile.sub
@@ -184,7 +184,7 @@ OBJS = array.obj \
all: miniruby$(EXEEXT) rbconfig.rb \
$(LIBRUBY) $(MISCLIBS)
- @.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)"
+ @.\miniruby$(EXEEXT) $(srcdir)ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)"
ruby: $(PROGRAM)
rubyw: $(WPROGRAM)
@@ -407,8 +407,8 @@ $(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
$(MINIRUBY) $(srcdir)bcc32/mkexports.rb -output=$@ $(LIBRUBY_A)
install: rbconfig.rb
- $(MINIRUBY) $(srcdir)instruby.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
- $(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
+ $(MINIRUBY) $(srcdir)instruby.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
+ $(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
clean: clean-ext clean-local
@@ -425,7 +425,7 @@ clean-local:
@if exist *.il? del *.il?
clean-ext:
- @-$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)" clean
+ @-$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" clean
distclean: distclean-ext distclean-local
@@ -459,7 +459,7 @@ distclean-local: clean-local
@if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
distclean-ext:
- @-$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)" distclean
+ @-$(MINIRUBY) $(srcdir)ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" distclean
realclean: distclean
@if exist parse.c del parse.c
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 3ff15514d7..5e86078d7b 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -105,8 +105,11 @@ getopts('', 'extstatic', 'make:', 'make-flags:')
$force_static = $OPT['extstatic'] == 'static'
$make = $OPT['make'] || $make
$mflags = Shellwords.shellwords($OPT['make-flags'] || "")
+$mflags[0].sub!(/^(?=\w+)$/, "-") unless mflags.empty?
+$make, *$mflags[0, 0] = Shellwords.shellwords($make)
mflags = $mflags.grep(/^-([^-].*)/) {$1}.join
+mflags.downcase! if $nmake == ?m
$continue = mflags.include?(?k)
$dryrun = mflags.include?(?n)
diff --git a/instruby.rb b/instruby.rb
index 4e82a35b91..c07a3ff56d 100644
--- a/instruby.rb
+++ b/instruby.rb
@@ -12,9 +12,13 @@ File.umask(0)
getopts("n", "make:", "make-flags:")
$dryrun = $OPT["n"]
-Shellwords.shellwords($OPT["make-flags"] || "").grep(/^-[^-]*n/) do
- break $dryrun = true
-end
+mflags = Shellwords.shellwords($OPT["make-flags"] || "")
+mflags[0].sub!(/^(?=\w+)$/, "-") unless mflags.empty?
+make, *mflags[0, 0] = Shellwords.shellwords($OPT['make'] || ENV["MAKE"] || "")
+mflags = mflags.grep(/^-[^-]*/) {$1}.join
+mflags.downcase! if /nmake/i == make
+$dryrun = true if mflags.include?(?n)
+
ARGV.delete_if{|x|x[0] == ?-}
destdir = ARGV[0] || ''
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index ab0d2acd2d..4503070f50 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -171,7 +171,7 @@ OBJS = array.obj \
all: ext miniruby$(EXEEXT) rbconfig.rb \
$(LIBRUBY) $(MISCLIBS)
- @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)"
+ @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic=$(EXTSTATIC) --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)"
ext:
@mkdir $@
@@ -407,8 +407,8 @@ $(RUBYDEF): $(LIBRUBY_A) miniruby$(EXEEXT)
$(AR) $(ARFLAGS)$@ -def:$<
install: rbconfig.rb
- $(MINIRUBY) $(srcdir)/instruby.rb --make-flags "-$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
- $(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
+ $(MINIRUBY) $(srcdir)/instruby.rb --make-flags "$(MFLAGS)$(MAKEFLAGS)" $(DESTDIR)
+ $(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS) DESTDIR=$(DESTDIR)" install
clean: clean-ext clean-local
@@ -423,7 +423,7 @@ clean-local:
@if exist *.res del *.res
clean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)" clean
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" clean
distclean: distclean-ext distclean-local
@@ -457,7 +457,7 @@ distclean-local: clean-local
@if exist miniruby$(EXEEXT) del miniruby$(EXEEXT)
distclean-ext:
- @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "-$(MFLAGS)$(MAKEFLAGS)" distclean
+ @-$(MINIRUBY) $(srcdir)/ext/extmk.rb --make "$(MAKE)" --make-flags "$(MFLAGS)$(MAKEFLAGS)" distclean
realclean: distclean
@if exist parse.c del parse.c