ruby-changes:45365
From: nobu <ko1@a...>
Date: Fri, 27 Jan 2017 16:16:42 +0900 (JST)
Subject: [ruby-changes:45365] nobu:r57438 (trunk): exts.mk.tmpl: for not GNU makes
nobu 2017-01-27 16:16:36 +0900 (Fri, 27 Jan 2017) New Revision: 57438 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=57438 Log: exts.mk.tmpl: for not GNU makes * template/exts.mk.tmpl: use `cd` then `make` instead of `make -C` when not GNU make. Modified files: trunk/common.mk trunk/template/exts.mk.tmpl Index: template/exts.mk.tmpl =================================================================== --- template/exts.mk.tmpl (revision 57437) +++ template/exts.mk.tmpl (revision 57438) @@ -9,6 +9,11 @@ require './rbconfig' https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L9 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 https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L62 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%>: https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L101 % 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: Index: common.mk =================================================================== --- common.mk (revision 57437) +++ common.mk (revision 57438) @@ -215,7 +215,7 @@ $(EXTS_MK): ext/configure-ext.mk $(TIMES https://github.com/ruby/ruby/blob/trunk/common.mk#L215 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 $@ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/