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

33 lines
828 B
Cheetah
Raw Normal View History

V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@:)
ECHO = $(ECHO1:0=@echo)
<%
srcdir = miniruby = script_args = nil
opt = OptionParser.new do |o|
o.on('--srcdir=SRCDIR') {|v| srcdir = v}
o.on('--miniruby=MINIRUBY') {|v| miniruby = v}
o.on('--script-args=MINIRUBY') {|v| script_args = v}
o.order!(ARGV)
end
srcdir ||= File.dirname(File.dirname(__FILE__))
exts = Dir.glob("#{srcdir}/ext/*/").map(&File.method(:basename))
%>
MINIRUBY = <%=miniruby%>
SCRIPT_ARGS = <%=script_args%>
all:
% exts.each do |dir|
all: ext/<%=dir%>/exts.mk
ext/<%=dir%>/exts.mk: FORCE
$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make='$(MAKE)' --command-output=ext/<%=dir%>/exts.mk \
$(SCRIPT_ARGS) --extension=<%=dir%> --extstatic $(EXTSTATIC) \
--gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
-- subconfigure
% end
.PHONY: FORCE
FORCE: