なかだです。

At Sat, 25 Jan 2003 18:59:34 +0000,
knu wrote:
>   Log:
>     * instruby.rb, ext/extmk.rb, Makefile.in, win32/Makefile.sub,
>       bcc32/Makefile.sub: Replace the complicated MFLAGS/MAKEFLAGS
>       parser with something plain and comprehensible.  This fixes a
>       bug where make flags were wrongly reordered and the resulted
>       command line often did not make sense especially when BSD make
>       is used with extra arguments given.  Tested with FreeBSD and
>       Linux by me and mswin32, bccwin32 and mingw by usa.

GNU makeだと$(MAKE)は直接含まれていないと特別な意味を持たないよ
うです。+フラグってどの程度移植性があるもんなんでしょうか。

あとmake -n installで$dryrunにならなくなってますが、no-install
があるから不要ってことでしょうか。というか、だから$(MAKE)が特別
扱いされなくても構わない?


Index: Makefile.in =================================================================== RCS file: /cvs/ruby/src/ruby/Makefile.in,v retrieving revision 1.42 diff -u -2 -p -r1.42 Makefile.in --- Makefile.in 25 Jan 2003 18:59:33 -0000 1.42 +++ Makefile.in 25 Jan 2003 21:25:35 -0000 @@ -109,5 +109,5 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY) - @$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="@EXTSTATIC@" $(SCRIPT_ARGS) + @+$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="@EXTSTATIC@" $(SCRIPT_ARGS) miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@ @@ -134,13 +134,13 @@ ruby.imp: $(LIBRUBY_A) install: rbconfig.rb - $(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)" - $(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) install + +$(MINIRUBY) $(srcdir)/instruby.rb $(SCRIPT_ARGS) --mantype="$(MANTYPE)" + +$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) install what-where no-install: rbconfig.rb - $(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)" - $(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(SCRIPT_ARGS) install + +$(MINIRUBY) $(srcdir)/instruby.rb -n $(SCRIPT_ARGS) --mantype="$(MANTYPE)" + +$(MINIRUBY) $(srcdir)/ext/extmk.rb -n $(SCRIPT_ARGS) install clean-ext: - @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) clean 2> /dev/null || true + @-+$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) clean 2> /dev/null || true clean-local: @@ -152,5 +152,5 @@ clean: clean-ext clean-local distclean-ext: - @-$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) distclean 2> /dev/null || true + @-+$(MINIRUBY) $(srcdir)/ext/extmk.rb $(SCRIPT_ARGS) distclean 2> /dev/null || true distclean-local: clean-local Index: instruby.rb =================================================================== RCS file: /cvs/ruby/src/ruby/instruby.rb,v retrieving revision 1.43 diff -u -2 -p -r1.43 instruby.rb --- instruby.rb 25 Jan 2003 18:59:33 -0000 1.43 +++ instruby.rb 25 Jan 2003 21:25:35 -0000 @@ -19,5 +19,5 @@ def parse_args() $dryrun = $OPT['n'] $destdir = $OPT['dest-dir'] || '' - $make = $OPT['make'] || $make + $make = $OPT['make'] || $make || "make" make_flags = ($OPT['make-flags'] || '').strip mflags = ($OPT['mflags'] || '').strip @@ -35,5 +35,10 @@ def parse_args() $mflags.unshift(*rest) unless rest.empty? + def $mflags.set?(flag) + grep(Regexp.new("^-(?!-).*%c"%flag, /nmake/ =~ $nmake)) {break true} + end + $mflags << '-n' if $dryrun + $dryrun ||= $mflags.set?(?n) $mflags << "DESTDIR=#{$destdir}" @@ -42,5 +47,5 @@ def parse_args() # we can just search with exact match. Only nmake puts flags # together, but nmake does not propagate -k via MAKEFLAGS anyway. - $continue = $mflags.include?('-k') + $continue = $mflags.set?(?k) end Index: ext/extmk.rb =================================================================== RCS file: /cvs/ruby/src/ruby/ext/extmk.rb,v retrieving revision 1.27 diff -u -2 -p -r1.27 extmk.rb --- ext/extmk.rb 25 Jan 2003 18:59:34 -0000 1.27 +++ ext/extmk.rb 25 Jan 2003 21:25:35 -0000 @@ -137,5 +137,10 @@ def parse_args() $mflags.unshift(*rest) unless rest.empty? + def $mflags.set?(flag) + grep(Regexp.new("^-(?!-).*%c"%flag, $nmake == ?m)) {break true} + end + $mflags << '-n' if $dryrun + $dryrun ||= $mflags.set?(?n) $mflags << "DESTDIR=#{$destdir}" @@ -145,5 +150,5 @@ def parse_args() # puts flags together, but nmake does not propagate -k via MAKEFLAGS # anyway. - $continue = $mflags.include?('-k') + $continue = $mflags.set?(?k) end
-- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦