[前][次][番号順一覧][スレッド一覧]

ruby-changes:34583

From: nobu <ko1@a...>
Date: Thu, 3 Jul 2014 12:38:28 +0900 (JST)
Subject: [ruby-changes:34583] nobu:r46664 (trunk): extmk.rb: GNU make -C option

nobu	2014-07-03 12:38:13 +0900 (Thu, 03 Jul 2014)

  New Revision: 46664

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46664

  Log:
    extmk.rb: GNU make -C option
    
    * ext/extmk.rb: use -C option for GNU make instead of shell.

  Modified files:
    trunk/common.mk
    trunk/defs/gmake.mk
    trunk/ext/extmk.rb
Index: defs/gmake.mk
===================================================================
--- defs/gmake.mk	(revision 46663)
+++ defs/gmake.mk	(revision 46664)
@@ -1,4 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/defs/gmake.mk#L1
 # -*- makefile-gmake -*-
+gnumake = yes
+
 TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
 TEST_TARGETS += $(subst check,test-all,$(patsubst check-%,test-%,$(TEST_TARGETS)))
 TEST_TARGETS := $(patsubst test-%,yes-test-%,$(patsubst btest-%,yes-btest-%,$(TEST_TARGETS)))
Index: common.mk
===================================================================
--- common.mk	(revision 46663)
+++ common.mk	(revision 46664)
@@ -119,7 +119,8 @@ SCRIPT_ARGS   =	--dest-dir="$(DESTDIR)" https://github.com/ruby/ruby/blob/trunk/common.mk#L119
 		--mflags="$(MFLAGS)" \
 		--make-flags="$(MAKEFLAGS)"
 EXTMK_ARGS    =	$(SCRIPT_ARGS) --extension $(EXTS) --extstatic $(EXTSTATIC) \
-		--make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --
+		--make-flags="V=$(V) MINIRUBY='$(MINIRUBY)'" --gnumake=$(gnumake) \
+		--
 INSTRUBY      =	$(SUDO) $(RUNRUBY) -r./$(arch)-fake $(srcdir)/tool/rbinstall.rb
 INSTRUBY_ARGS =	$(SCRIPT_ARGS) \
 		--data-mode=$(INSTALL_DATA_MODE) \
Index: ext/extmk.rb
===================================================================
--- ext/extmk.rb	(revision 46663)
+++ ext/extmk.rb	(revision 46664)
@@ -371,6 +371,9 @@ def parse_args() https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L371
     opts.on('--command-output=FILE', String) do |v|
       $command_output = v
     end
+    opts.on('--gnumake=yes|no', true) do |v|
+      $gnumake = v
+    end
   end
   begin
     $optparser.parse!(ARGV)
@@ -718,10 +721,16 @@ if $configure_only and $command_output https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L721
       mf.puts "#{tgt}:\n\t#{submake} $@"
     end
     mf.puts
-    exec = config_string("exec") {|str| str + " "}
+    if $gnumake == "yes"
+      submake = "$(MAKE) -C $(@D)"
+    else
+      submake = "cd $(@D) && "
+      config_string("exec") {|str| submake << str << " "}
+      submake << "$(MAKE)"
+    end
     targets.each do |tgt|
       exts.each do |d|
-        mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)cd $(@D) && #{exec}$(MAKE) $(MFLAGS) V=$(V) $(@F)"
+        mf.puts "#{d[0..-2]}#{tgt}:\n\t$(Q)#{submake} $(MFLAGS) V=$(V) $(@F)"
       end
     end
   end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]