summaryrefslogtreecommitdiff
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
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
-rw-r--r--common.mk2
-rw-r--r--template/exts.mk.tmpl14
2 files changed, 14 insertions, 2 deletions
diff --git a/common.mk b/common.mk
index abd2eaa9e0..9a4f2df9c8 100644
--- a/common.mk
+++ b/common.mk
@@ -215,7 +215,7 @@ $(EXTS_MK): ext/configure-ext.mk $(TIMESTAMPDIR)/.$(arch).time $(srcdir)/templat
gnumake=$(gnumake) EXTLDFLAGS="$(EXTLDFLAGS)" srcdir="$(srcdir)"
$(ECHO) generating makefile $@
$(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
- $(srcdir)/template/exts.mk.tmpl
+ $(srcdir)/template/exts.mk.tmpl --gnumake=$(gnumake)
ext/configure-ext.mk: $(PREP) all-incs $(MKFILES) $(RBCONFIG) $(LIBRUBY)
$(ECHO) generating makefiles $@
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: