ruby/template/configure-ext.mk.tmpl

29 строки
687 B
Cheetah
Исходник Обычный вид История

V = 0
Q1 = $(V:1=)
Q = $(Q1:0=@)
ECHO1 = $(V:1=@:)
ECHO = $(ECHO1:0=@echo)
<%
srcdir = miniruby = nil
opt = OptionParser.new do |o|
o.on('--srcdir=SRCDIR') {|v| srcdir = v}
o.on('--miniruby=MINIRUBY') {|v| miniruby = v}
o.order!(ARGV)
end
srcdir ||= File.dirname(File.dirname(__FILE__))
exts = Dir.glob("#{srcdir}/ext/*/").map(&File.method(:basename))
%>
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 \
--extension=<%=dir%> --extstatic $(EXTSTATIC) \
--gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
-- subconfigure
% end
.PHONY: FORCE
FORCE: