1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2017-02-10 06:12:22 +00:00
parent 35533d0346
commit 92b710e64b
6 changed files with 28 additions and 26 deletions

View file

@ -423,7 +423,7 @@ clean-ext distclean-ext realclean-ext::
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;; \

View file

@ -11,6 +11,7 @@ Q = $(Q1:0=@)
ECHO0 = $(ECHO1:0=echo)
ECHO = @$(ECHO0)
mflags = $(MFLAGS)
gnumake_recursive =
UNICODE_VERSION = 9.0.0
@ -68,7 +69,7 @@ EXTSOLIBS =
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
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 $(MKFILES) $(RBCONFIG) $(LIBRUBY)
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)
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)/parse.y id.h
$(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: $(srcdir)/ext/rbconfig/sizeof/depend \
$(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: $(srcdir)/ext/rbconfig/sizeof/depend \
$(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:
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_UNICODE:yes=.unicode-tables.time): $(UNI
$(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.time: $(srcdir)/tool/generic_erb.rb \
# 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_UNICODE:yes=casefold.h): \
$(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=$@ \

View file

@ -1,5 +1,3 @@
#override MFLAGS := $(filter-out -j%,$(MFLAGS))
#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
include Makefile
ENABLE_SHARED=@ENABLE_SHARED@

View file

@ -1,6 +1,7 @@
# -*- 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))

View file

@ -1,5 +1,3 @@
#override MFLAGS := $(filter-out -j%,$(MFLAGS))
#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
include Makefile
-include uncommon.mk
include $(srcdir)/defs/gmake.mk

View file

@ -19,7 +19,7 @@ end
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
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:
% 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: