summaryrefslogtreecommitdiff
path: root/template/exts.mk.tmpl
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 07:16:36 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-01-27 07:16:36 +0000
commitdf05027c2d263cecfbf7f9f7132ea11e06976baa (patch)
treebf8c4bf4c23dd740d4a4905fc5555e61105f7e84 /template/exts.mk.tmpl
parent640bcdf217f69d83e96483a59ae7f9af4d534f43 (diff)
exts.mk.tmpl: for not GNU makes
* template/exts.mk.tmpl: use `cd` then `make` instead of `make -C` when not GNU make. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'template/exts.mk.tmpl')
-rw-r--r--template/exts.mk.tmpl14
1 files changed, 13 insertions, 1 deletions
diff --git a/template/exts.mk.tmpl b/template/exts.mk.tmpl
index 656d7fdcd1..6ce6625f34 100644
--- a/template/exts.mk.tmpl
+++ b/template/exts.mk.tmpl
@@ -9,6 +9,11 @@ require './rbconfig'
macros = {}
deps = []
note = []
+gnumake = false
+opt = OptionParser.new do |o|
+ o.on('--gnumake=BOOL') {|v| gnumake = v == 'yes'}
+ o.order!(ARGV)
+end
Dir.glob("ext/*/exts.mk") do |e|
s = File.read(e)
s.scan(/^(extensions|EXT[A-Z]+)[ \t]*=[ \t]*((?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*)$/) do |n, v|
@@ -57,6 +62,13 @@ def self.column
end
targets = %w[all static install install-so install-rb clean distclean realclean]
objext = RbConfig::CONFIG["OBJEXT"]
+if gnumake
+ submake = "$(MAKE) -C $(@D)"
+else
+ submake = "cd $(@D) && "
+ exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << str << " "
+ submake << "$(MAKE)"
+end
%>
extensions =<%= macros["extensions"].fold(column) %>
@@ -89,7 +101,7 @@ ext/extinit.<%=objext%>:
% targets.product(macros["extensions"].map {|e|e.chomp("/.")}) do |t, e|
<%=e%>/<%=t%>:
- $(Q)$(MAKE) -C $(@D) $(MFLAGS) V=$(V) $(@F)
+ $(Q)<%= submake %> $(MFLAGS) $(SUBMAKEOPTS) V=$(V) $(@F)
% end
extso: