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:
parent
35533d0346
commit
92b710e64b
6 changed files with 28 additions and 26 deletions
|
@ -423,7 +423,7 @@ clean-ext distclean-ext realclean-ext::
|
||||||
cd ..; \
|
cd ..; \
|
||||||
for dir do \
|
for dir do \
|
||||||
echo $(@:-ext=)ing "$$dir"; \
|
echo $(@:-ext=)ing "$$dir"; \
|
||||||
(cd "ext/$$dir" && exec $(MAKE) $(@:-ext=)) && \
|
(cd "ext/$$dir" && exec $(MAKE) $(mflags) $(@:-ext=)) && \
|
||||||
case "$@" in \
|
case "$@" in \
|
||||||
*distclean-ext*|*realclean-ext*) \
|
*distclean-ext*|*realclean-ext*) \
|
||||||
$(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
|
$(RMDIRS) "ext/$$dir" 2> /dev/null || true;; \
|
||||||
|
|
31
common.mk
31
common.mk
|
@ -11,6 +11,7 @@ Q = $(Q1:0=@)
|
||||||
ECHO0 = $(ECHO1:0=echo)
|
ECHO0 = $(ECHO1:0=echo)
|
||||||
ECHO = @$(ECHO0)
|
ECHO = @$(ECHO0)
|
||||||
|
|
||||||
|
mflags = $(MFLAGS)
|
||||||
gnumake_recursive =
|
gnumake_recursive =
|
||||||
|
|
||||||
UNICODE_VERSION = 9.0.0
|
UNICODE_VERSION = 9.0.0
|
||||||
|
@ -68,7 +69,7 @@ EXTSOLIBS =
|
||||||
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
|
MINIOBJS = $(ARCHMINIOBJS) miniinit.$(OBJEXT) dmyext.$(OBJEXT) miniprelude.$(OBJEXT)
|
||||||
ENC_MK = enc.mk
|
ENC_MK = enc.mk
|
||||||
MAKE_ENC = -f $(ENC_MK) V="$(V)" UNICODE_HDR_DIR="$(UNICODE_HDR_DIR)" \
|
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) \
|
COMMONOBJS = array.$(OBJEXT) \
|
||||||
bignum.$(OBJEXT) \
|
bignum.$(OBJEXT) \
|
||||||
|
@ -213,7 +214,7 @@ exts: build-ext
|
||||||
|
|
||||||
EXTS_MK = exts.mk
|
EXTS_MK = exts.mk
|
||||||
$(EXTS_MK): ext/configure-ext.mk $(TIMESTAMPDIR)/.$(arch).time $(srcdir)/template/exts.mk.tmpl
|
$(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)"
|
gnumake=$(gnumake) EXTLDFLAGS="$(EXTLDFLAGS)" srcdir="$(srcdir)"
|
||||||
$(ECHO) generating makefile $@
|
$(ECHO) generating makefile $@
|
||||||
$(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \
|
$(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)
|
configure-ext: $(EXTS_MK)
|
||||||
|
|
||||||
build-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)
|
EXTENCS="$(ENCOBJS)" UPDATE_LIBRARIES=no $(EXTSTATIC)
|
||||||
|
|
||||||
ext/extinit.c: $(srcdir)/template/extinit.c.tmpl
|
ext/extinit.c: $(srcdir)/template/extinit.c.tmpl
|
||||||
|
@ -246,7 +247,7 @@ objs: $(ALLOBJS)
|
||||||
|
|
||||||
GORUBY = go$(RUBY_INSTALL_NAME)
|
GORUBY = go$(RUBY_INSTALL_NAME)
|
||||||
golf: $(LIBRUBY) $(GOLFOBJS) PHONY
|
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
|
capi: $(CAPIOUT)/.timestamp PHONY
|
||||||
|
|
||||||
$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
|
$(CAPIOUT)/.timestamp: Doxyfile $(PREP)
|
||||||
|
@ -924,18 +925,18 @@ $(srcdir)/ext/ripper/ripper.c: $(srcdir)/parse.y id.h
|
||||||
$(ECHO) generating $@
|
$(ECHO) generating $@
|
||||||
$(Q) $(CHDIR) $(@D) && \
|
$(Q) $(CHDIR) $(@D) && \
|
||||||
sed /AUTOGENERATED/q depend | \
|
sed /AUTOGENERATED/q depend | \
|
||||||
$(exec) $(MAKE) -f - \
|
$(exec) $(MAKE) -f - $(mflags) \
|
||||||
Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \
|
Q=$(Q) ECHO=$(ECHO) RM="$(RM)" top_srcdir=../.. srcdir=. VPATH="$(PWD)" \
|
||||||
RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
|
RUBY="$(BASERUBY)" PATH_SEPARATOR="$(PATH_SEPARATOR)"
|
||||||
|
|
||||||
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
|
$(srcdir)/ext/json/parser/parser.c: $(srcdir)/ext/json/parser/parser.rl
|
||||||
$(ECHO) generating $@
|
$(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)"
|
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. BASERUBY="$(BASERUBY)"
|
||||||
|
|
||||||
$(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list
|
$(srcdir)/ext/date/zonetab.h: $(srcdir)/ext/date/zonetab.list
|
||||||
$(ECHO) generating $@
|
$(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)"
|
Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. BASERUBY="$(BASERUBY)"
|
||||||
|
|
||||||
$(srcdir)/ext/rbconfig/sizeof/sizes.c: $(srcdir)/ext/rbconfig/sizeof/depend \
|
$(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 $@
|
$(ECHO) generating $@
|
||||||
$(Q) $(CHDIR) $(@D) && \
|
$(Q) $(CHDIR) $(@D) && \
|
||||||
sed '/AUTOGENERATED/q' depend | \
|
sed '/AUTOGENERATED/q' depend | \
|
||||||
$(exec) $(MAKE) -f - \
|
$(exec) $(MAKE) -f - $(mflags) \
|
||||||
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
|
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
|
||||||
|
|
||||||
$(srcdir)/ext/rbconfig/sizeof/limits.c: $(srcdir)/ext/rbconfig/sizeof/depend \
|
$(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 $@
|
$(ECHO) generating $@
|
||||||
$(Q) $(CHDIR) $(@D) && \
|
$(Q) $(CHDIR) $(@D) && \
|
||||||
sed '/AUTOGENERATED/q' depend | \
|
sed '/AUTOGENERATED/q' depend | \
|
||||||
$(exec) $(MAKE) -f - \
|
$(exec) $(MAKE) -f - $(mflags) \
|
||||||
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
|
Q=$(Q) ECHO=$(ECHO) top_srcdir=../../.. srcdir=. VPATH=../../.. RUBY="$(BASERUBY)" $(@F)
|
||||||
|
|
||||||
$(srcdir)/ext/socket/constdefs.c: $(srcdir)/ext/socket/depend
|
$(srcdir)/ext/socket/constdefs.c: $(srcdir)/ext/socket/depend
|
||||||
$(Q) $(CHDIR) $(@D) && \
|
$(Q) $(CHDIR) $(@D) && \
|
||||||
sed '/AUTOGENERATED/q' depend | \
|
sed '/AUTOGENERATED/q' depend | \
|
||||||
$(exec) $(MAKE) -f - \
|
$(exec) $(MAKE) -f - $(mflags) \
|
||||||
Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
|
Q=$(Q) ECHO=$(ECHO) top_srcdir=../.. srcdir=. VPATH=../.. RUBY="$(BASERUBY)"
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -1031,10 +1032,10 @@ dist:
|
||||||
up:: update-remote
|
up:: update-remote
|
||||||
|
|
||||||
up::
|
up::
|
||||||
-$(Q)$(MAKE) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
|
-$(Q)$(MAKE) $(mflags) Q=$(Q) REVISION_FORCE=PHONY "$(REVISION_H)"
|
||||||
|
|
||||||
up::
|
up::
|
||||||
-$(Q)$(MAKE) Q=$(Q) after-update
|
-$(Q)$(MAKE) $(mflags) Q=$(Q) after-update
|
||||||
|
|
||||||
after-update:: extract-extlibs
|
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 \
|
$(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
|
||||||
$(srcdir)/template/unicode_norm_gen.tmpl
|
$(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 \
|
$(Q) $(BASERUBY) $(srcdir)/tool/generic_erb.rb \
|
||||||
-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
|
-c -t$@ -o $(srcdir)/lib/unicode_normalize/tables.rb \
|
||||||
-I $(srcdir) \
|
-I $(srcdir) \
|
||||||
|
@ -1127,7 +1128,7 @@ $(UNICODE_SRC_DATA_DIR)/.unicode-tables.time: $(srcdir)/tool/generic_erb.rb \
|
||||||
# UPDATE_NAME2CTYPE= : toplevel
|
# UPDATE_NAME2CTYPE= : toplevel
|
||||||
# UPDATE_NAME2CTYPE=yes : sub-make to update name2ctype.h
|
# UPDATE_NAME2CTYPE=yes : sub-make to update name2ctype.h
|
||||||
$(UNICODE_HDR_DIR)/$(UPDATE_NAME2CTYPE:yes=.ignore.)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_HDR_DIR)/$(UPDATE_NAME2CTYPE:yes=name2ctype.h): \
|
||||||
$(UNICODE_SRC_DATA_DIR)/UnicodeData.txt \
|
$(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_SRC_DATA_DIR)/CaseFolding.txt
|
||||||
|
|
||||||
$(UNICODE_HDR_DIR)/casefold.h: $(srcdir)/enc/unicode/case-folding.rb
|
$(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)
|
$(MAKEDIRS) $(@D)
|
||||||
$(Q) $(BASERUBY) $(srcdir)/enc/unicode/case-folding.rb \
|
$(Q) $(BASERUBY) $(srcdir)/enc/unicode/case-folding.rb \
|
||||||
--output-file=$@ \
|
--output-file=$@ \
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#override MFLAGS := $(filter-out -j%,$(MFLAGS))
|
|
||||||
#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
|
|
||||||
include Makefile
|
include Makefile
|
||||||
|
|
||||||
ENABLE_SHARED=@ENABLE_SHARED@
|
ENABLE_SHARED=@ENABLE_SHARED@
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# -*- makefile-gmake -*-
|
# -*- makefile-gmake -*-
|
||||||
gnumake = yes
|
gnumake = yes
|
||||||
override gnumake_recursive := +
|
override gnumake_recursive := +
|
||||||
|
mflags := $(filter-out -j%,$(MFLAGS))
|
||||||
|
|
||||||
CHECK_TARGETS := exam love check%
|
CHECK_TARGETS := exam love check%
|
||||||
TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
|
TEST_TARGETS := $(filter check test check% test% btest%,$(MAKECMDGOALS))
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
#override MFLAGS := $(filter-out -j%,$(MFLAGS))
|
|
||||||
#override MAKEFLAGS := $(filter-out -j%,$(MAKEFLAGS))
|
|
||||||
include Makefile
|
include Makefile
|
||||||
-include uncommon.mk
|
-include uncommon.mk
|
||||||
include $(srcdir)/defs/gmake.mk
|
include $(srcdir)/defs/gmake.mk
|
||||||
|
|
|
@ -19,7 +19,7 @@ end
|
||||||
Dir.glob("{ext,gems}/*/exts.mk") do |e|
|
Dir.glob("{ext,gems}/*/exts.mk") do |e|
|
||||||
gem = /\Agems(?=\/)/ =~ e
|
gem = /\Agems(?=\/)/ =~ e
|
||||||
s = File.read(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]*/, ' ')
|
v.gsub!(/\\\n[ \t]*/, ' ')
|
||||||
next if v.empty?
|
next if v.empty?
|
||||||
next if gem and n != "extensions"
|
next if gem and n != "extensions"
|
||||||
|
@ -85,8 +85,12 @@ else
|
||||||
submake = "cd $(@D) && "
|
submake = "cd $(@D) && "
|
||||||
exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << exec << " "
|
exec = RbConfig::CONFIG["exec"] and !exec.empty? and submake << exec << " "
|
||||||
submake << "$(MAKE)"
|
submake << "$(MAKE)"
|
||||||
|
mflags = " $(MFLAGS)"
|
||||||
end
|
end
|
||||||
%>
|
-%>
|
||||||
|
% unless macros["MFLAGS"].empty?
|
||||||
|
MFLAGS =<%= macros["MFLAGS"].fold(column) %>
|
||||||
|
% end
|
||||||
|
|
||||||
extensions =<%= macros["extensions"].fold(column) %>
|
extensions =<%= macros["extensions"].fold(column) %>
|
||||||
EXTOBJS =<%= macros["EXTOBJS"].fold(column) %>
|
EXTOBJS =<%= macros["EXTOBJS"].fold(column) %>
|
||||||
|
@ -111,17 +115,17 @@ distclean:
|
||||||
|
|
||||||
% rubies.each do |ruby|
|
% rubies.each do |ruby|
|
||||||
<%= ruby %>:
|
<%= ruby %>:
|
||||||
$(Q)$(MAKE) $(SUBMAKEOPTS) $@
|
$(Q)$(MAKE)<%=mflags%> $(SUBMAKEOPTS) $@
|
||||||
% end
|
% end
|
||||||
|
|
||||||
libencs:
|
libencs:
|
||||||
$(Q)$(MAKE) -f enc.mk V=$(V) $@
|
$(Q)$(MAKE)<%=mflags%> -f enc.mk V=$(V) $@
|
||||||
ext/extinit.<%=objext%>:
|
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|
|
% targets.product(macros["extensions"].map {|e|e.chomp("/.")}) do |t, e|
|
||||||
<%=e%>/<%=t%>:
|
<%=e%>/<%=t%>:
|
||||||
$(Q)<%= submake %> V=$(V) $(@F)
|
$(Q)<%= submake %><%=mflags%> V=$(V) $(@F)
|
||||||
% end
|
% end
|
||||||
|
|
||||||
extso:
|
extso:
|
||||||
|
|
Loading…
Reference in a new issue