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

ruby-changes:45521

From: nobu <ko1@a...>
Date: Fri, 10 Feb 2017 15:12:27 +0900 (JST)
Subject: [ruby-changes:45521] nobu:r57594 (trunk): MFLAGS for nmake

nobu	2017-02-10 15:12:22 +0900 (Fri, 10 Feb 2017)

  New Revision: 57594

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

  Log:
    MFLAGS for nmake
    
    * common.mk (mflags): pass make flags to sub-makes, for nmake
      which cannot pass them by the environment variable.
    
    * defs/gmake.mk (mflags): filter out -j option for sub-makes.
    
    * template/exts.mk.tmpl (MFLAGS): extract MFLAGS from sub extmk
      files for nmake.

  Modified files:
    trunk/Makefile.in
    trunk/common.mk
    trunk/cygwin/GNUmakefile.in
    trunk/defs/gmake.mk
    trunk/template/GNUmakefile.in
    trunk/template/exts.mk.tmpl
Index: common.mk
===================================================================
--- common.mk	(revision 57593)
+++ common.mk	(revision 57594)
@@ -11,6 +11,7 @@ Q = $(Q1:0=@) https://github.com/ruby/ruby/blob/trunk/common.mk#L11
 ECHO0 = $(ECHO1:0=echo)
 ECHO = @$(ECHO0)
 
+mflags = $(MFLAGS)
 gnumake_recursive =
 
 UNICODE_VERSION = 9.0.0
@@ -68,7 +69,7 @@ EXTSOLIBS     = https://github.com/ruby/ruby/blob/trunk/common.mk#L69
 MINIOBJS      = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
 ENC_MK        = enc.mk
 MAKE_ENC      = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
-		RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)"
+		RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(mflags)
 
 COMMONOBJS    = array.$(OBJEXT) \
 		bignum.$(OBJEXT) \
@@ -213,7 +214,7 @@ exts: build-ext https://github.com/ruby/ruby/blob/trunk/common.mk#L214
 
 EXTS_MK = exts.mk
 $(EXTS_MK): ext/configure-ext.mk $(TIMESTAMPDIR)/.$(arch).time $(srcdir)/template/exts.mk.tmpl
-	$(MAKE) -f ext/configure-ext.mk V=$(V) EXTSTATIC=$(EXTSTATIC) \
+	$(Q)$(MAKE) -f ext/configure-ext.mk $(mflags) V=$(V) EXTSTATIC=$(EXTSTATIC) \
 		gnumake=$(gnumake) EXTLDFLAGS="$(EXTLDFLAGS)" srcdir="$(srcdir)"
 	$(ECHO) generating makefile $@
 	$(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
@@ -229,7 +230,7 @@ ext/configure-ext.mk: $(PREP) all-incs $ https://github.com/ruby/ruby/blob/trunk/common.mk#L230
 configure-ext: $(EXTS_MK)
 
 build-ext: $(EXTS_MK)
-	$(Q)$(MAKE) -f $(EXTS_MK) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) \
+	$(Q)$(MAKE) -f $(EXTS_MK) $(mflags) libdir="$(libdir)" LIBRUBY_EXTS=$(LIBRUBY_EXTS) \
 	    EXTENCS="$(ENCOBJS)" UPDATE_LIBRARIES=no $(EXTSTATIC)
 
 ext/extinit.c: $(srcdir)/template/extinit.c.tmpl
@@ -246,7 +247,7 @@ objs: $(ALLOBJS) https://github.com/ruby/ruby/blob/trunk/common.mk#L247
 
 GORUBY = go$(RUBY_INSTALL_NAME)
 golf: $(LIBRUBY) $(GOLFOBJS) PHONY
-	$(Q) $(MAKE) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
+	$(Q) $(MAKE) $(mflags) MAINOBJ="$(GOLFOBJS)" PROGRAM=$(GORUBY)$(EXEEXT) program
 capi: $(CAPIOUT)/.timestamp PHONY
 
 $(CAPIOUT)/.timestamp: Doxyfile $(PREP)
@@ -924,18 +925,18 @@ $(srcdir)/ext/ripper/ripper.c: $(srcdir) https://github.com/ruby/ruby/blob/trunk/common.mk#L925
 	$(ECHO) generating $@
 	$(Q) $(CHDIR) $(@D) && \
 	sed /AUTOGENERATED/q depend | \
-	$(exec) $(MAKE) -f - \
+	$(exec) $(MAKE) -f - $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \
 		RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
 
 $(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
 	$(ECHO) generating $@
-	$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk \
+	$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)"
 
 $(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list
 	$(ECHO) generating $@
-	$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk \
+	$(Q) $(CHDIR) $(@D) && $(exec) $(MAKE) -f prereq.mk $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. BASERUBY="$(BASERUBY)"
 
 $(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
@@ -943,7 +944,7 @@ $(srcdir)/ext/rbconfig/sizeof/sizes.c: $ https://github.com/ruby/ruby/blob/trunk/common.mk#L944
 	$(ECHO) generating $@
 	$(Q) $(CHDIR) $(@D) && \
 	sed '/AUTOGENERATED/q' depend | \
-	$(exec) $(MAKE) -f - \
+	$(exec) $(MAKE) -f - $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
 
 $(srcdir)/ext/rbconfig/sizeof/limits.c: $(srcdir)/ext/rbconfig/sizeof/depend \
@@ -951,13 +952,13 @@ $(srcdir)/ext/rbconfig/sizeof/limits.c: https://github.com/ruby/ruby/blob/trunk/common.mk#L952
 	$(ECHO) generating $@
 	$(Q) $(CHDIR) $(@D) && \
 	sed '/AUTOGENERATED/q' depend | \
-	$(exec) $(MAKE) -f - \
+	$(exec) $(MAKE) -f - $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
 
 $(srcdir)/ext/socket/constdefs.c: $(srcdir)/ext/socket/depend
 	$(Q) $(CHDIR) $(@D) && \
 	sed '/AUTOGENERATED/q' depend | \
-	$(exec) $(MAKE) -f - \
+	$(exec) $(MAKE) -f - $(mflags) \
 		Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
 
 ##
@@ -1031,10 +1032,10 @@ dist: https://github.com/ruby/ruby/blob/trunk/common.mk#L1032
 up:: update-remote
 
 up::
-	-$(Q)$(MAKE) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
+	-$(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
 
 up::
-	-$(Q)$(MAKE) Q=$(Q) after-update
+	-$(Q)$(MAKE) $(mflags) Q=$(Q) after-update
 
 after-update:: extract-extlibs
 
@@ -1117,7 +1118,7 @@ $(UNICODE_SRC_DATA_DIR)/$(ALWAYS_UPDATE_ https://github.com/ruby/ruby/blob/trunk/common.mk#L1118
 
 $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
 		$(srcdir)/template/unicode_norm_gen.tmpl
-	$(Q) $(ALWAYS_UPDATE_UNICODE:yes=exit &&) $(MAKE) Q=$(Q) UNICODE_VERSION=$(UNICODE_VERSION) update-unicode
+	$(Q) $(ALWAYS_UPDATE_UNICODE:yes=exit &&) $(MAKE) $(mflags) Q=$(Q) UNICODE_VERSION=$(UNICODE_VERSION) update-unicode
 	$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
 		-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
 		-I $(srcdir) \
@@ -1127,7 +1128,7 @@ $(UNICODE_SRC_DATA_DIR)/.unicode-tables. https://github.com/ruby/ruby/blob/trunk/common.mk#L1128
 # UPDATE_NAME2CTYPE=    : toplevel
 # UPDATE_NAME2CTYPE=yes : sub-make to update name2ctype.h
 $(UNICODE_HDR_DIR)/$(UPDATE_NAME2CTYPE:yes=.ignore.)name2ctype.h:
-	$(Q) $(MAKE) Q=$(Q) UPDATE_NAME2CTYPE=yes UNICODE_VERSION=$(UNICODE_VERSION) $@
+	$(Q) $(MAKE) $(mflags) Q=$(Q) UPDATE_NAME2CTYPE=yes UNICODE_VERSION=$(UNICODE_VERSION) $@
 
 $(UNICODE_HDR_DIR)/$(UPDATE_NAME2CTYPE:yes=name2ctype.h): \
 		$(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
@@ -1146,7 +1147,7 @@ $(UNICODE_HDR_DIR)/$(ALWAYS_UPDATE_UNICO https://github.com/ruby/ruby/blob/trunk/common.mk#L1147
 		$(UNICODE_SRC_DATA_DIR)/CaseFolding.txt
 
 $(UNICODE_HDR_DIR)/casefold.h: $(srcdir)/enc/unicode/case-folding.rb
-	$(Q) $(ALWAYS_UPDATE_UNICODE:yes=exit &&) $(MAKE) Q=$(Q) UNICODE_VERSION=$(UNICODE_VERSION) update-unicode
+	$(Q) $(ALWAYS_UPDATE_UNICODE:yes=exit &&) $(MAKE) $(mflags) Q=$(Q) UNICODE_VERSION=$(UNICODE_VERSION) update-unicode
 	$(MAKEDIRS) $(@D)
 	$(Q) $(BASERUBY) $(srcdir)/enc/unicode/case-folding.rb \
 		--output-file=$@ \
Index: template/GNUmakefile.in
===================================================================
--- template/GNUmakefile.in	(revision 57593)
+++ template/GNUmakefile.in	(revision 57594)
@@ -1,5 +1,3 @@ https://github.com/ruby/ruby/blob/trunk/template/GNUmakefile.in#L1
-#override MFLAGS := $(filter-out -j%,$(MFLAGS))
-#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
 include Makefile
 -include uncommon.mk
 include $(srcdir)/defs/gmake.mk
Index: template/exts.mk.tmpl
===================================================================
--- template/exts.mk.tmpl	(revision 57593)
+++ template/exts.mk.tmpl	(revision 57594)
@@ -19,7 +19,7 @@ end https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L19
 Dir.glob("{ext,gems}/*/exts.mk") do |e|
   gem = /\Agems(?=\/)/ =~ e
   s = File.read(e)
-  s.scan(/^(extensions|EXT[A-Z]+)[ \t]*=[ \t]*((?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*)$/) do |n, v|
+  s.scan(/^(extensions|EXT[A-Z]+|MFLAGS)[ \t]*=[ \t]*((?>(?>[^\\\n]|\\.)*\\\n)*(?>[^\\\n]|\\.)*)$/) do |n, v|
     v.gsub!(/\\\n[ \t]*/, ' ')
     next if v.empty?
     next if gem and n != "extensions"
@@ -85,8 +85,12 @@ else https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L85
   submake = "cd $(@D) && "
   exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << exec << " "
   submake << "$(MAKE)"
+  mflags = " $(MFLAGS)"
 end
-%>
+-%>
+% unless macros["MFLAGS"].empty?
+MFLAGS =<%= macros["MFLAGS"].fold(column) %>
+% end
 
 extensions =<%= macros["extensions"].fold(column) %>
 EXTOBJS =<%= macros["EXTOBJS"].fold(column) %>
@@ -111,17 +115,17 @@ distclean: https://github.com/ruby/ruby/blob/trunk/template/exts.mk.tmpl#L115
 
 % rubies.each do |ruby|
 <%= ruby %>:
-	$(Q)$(MAKE) $(SUBMAKEOPTS) $@
+	$(Q)$(MAKE)<%=mflags%> $(SUBMAKEOPTS) $@
 % end
 
 libencs:
-	$(Q)$(MAKE) -f enc.mk V=$(V) $@
+	$(Q)$(MAKE)<%=mflags%> -f enc.mk V=$(V) $@
 ext/extinit.<%=objext%>:
-	$(Q)$(MAKE) V=$(V) EXTINITS="$(EXTINITS)" $@
+	$(Q)$(MAKE)<%=mflags%> V=$(V) EXTINITS="$(EXTINITS)" $@
 
 % targets.product(macros["extensions"].map {|e|e.chomp("/.")}) do |t, e|
 <%=e%>/<%=t%>:
-	$(Q)<%= submake %> V=$(V) $(@F)
+	$(Q)<%= submake %><%=mflags%> V=$(V) $(@F)
 % end
 
 extso:
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 57593)
+++ Makefile.in	(revision 57594)
@@ -423,7 +423,7 @@ clean-ext distclean-ext realclean-ext:: https://github.com/ruby/ruby/blob/trunk/Makefile.in#L423
 	cd ..; \
 	for dir do \
 	    echo $(@:-ext=)ing "$$dir"; \
-	    (cd "ext/$$dir" && exec $(MAKE) $(@:-ext=)) && \
+	    (cd "ext/$$dir" && exec $(MAKE) $(mflags) $(@:-ext=)) && \
 	    case "$@" in \
 	    *distclean-ext*|*realclean-ext*) \
 		$(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
Index: defs/gmake.mk
===================================================================
--- defs/gmake.mk	(revision 57593)
+++ defs/gmake.mk	(revision 57594)
@@ -1,6 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/defs/gmake.mk#L1
 # -*- makefile-gmake -*-
 gnumake = yes
 override gnumake_recursive := +
+mflags := $(filter-out -j%,$(MFLAGS))
 
 CHECK_TARGETS := exam love check%
 TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
Index: cygwin/GNUmakefile.in
===================================================================
--- cygwin/GNUmakefile.in	(revision 57593)
+++ cygwin/GNUmakefile.in	(revision 57594)
@@ -1,5 +1,3 @@ https://github.com/ruby/ruby/blob/trunk/cygwin/GNUmakefile.in#L1
-#override MFLAGS := $(filter-out -j%,$(MFLAGS))
-#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
 include Makefile
 
 ENABLE_SHARED=@ENABLE_SHARED@

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

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