aboutsummaryrefslogtreecommitdiffstats
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-03 03:38:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-03 03:38:13 +0000
commit0b4e4b20cb02776b95093933596c633d10b46986 (patch)
tree181a0e57f3b09a9f9599ac8d111b1e21d5db4b35 /ext/extmk.rb
parent876bfc6b4ee6c0ddacbeff328dc428889d789a6b (diff)
downloadruby-0b4e4b20cb02776b95093933596c633d10b46986.tar.gz
extmk.rb: GNU make -C option
* ext/extmk.rb: use -C option for GNU make instead of shell. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 464c84725b..b11010feeb 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -371,6 +371,9 @@ def parse_args()
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
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