2017-01-23 05:50:23 +03:00
|
|
|
V = 0
|
|
|
|
Q1 = $(V:1=)
|
|
|
|
Q = $(Q1:0=@)
|
|
|
|
ECHO1 = $(V:1=@:)
|
|
|
|
ECHO = $(ECHO1:0=@echo)
|
|
|
|
|
|
|
|
<%
|
2017-01-23 07:22:23 +03:00
|
|
|
srcdir = miniruby = script_args = nil
|
2017-01-23 05:50:23 +03:00
|
|
|
opt = OptionParser.new do |o|
|
|
|
|
o.on('--srcdir=SRCDIR') {|v| srcdir = v}
|
|
|
|
o.on('--miniruby=MINIRUBY') {|v| miniruby = v}
|
2017-01-23 07:22:23 +03:00
|
|
|
o.on('--script-args=MINIRUBY') {|v| script_args = v}
|
2017-01-23 05:50:23 +03:00
|
|
|
o.order!(ARGV)
|
|
|
|
end
|
|
|
|
srcdir ||= File.dirname(File.dirname(__FILE__))
|
2017-01-26 11:19:34 +03:00
|
|
|
exts = {}
|
2017-01-28 08:02:41 +03:00
|
|
|
[
|
|
|
|
["exts", "ext", "--extstatic $(EXTSTATIC)"],
|
|
|
|
["gems", "gems", "--no-extstatic"],
|
2017-04-23 19:19:22 +03:00
|
|
|
].each do |t, d, o|
|
|
|
|
exts[t] = [o, Dir.glob("#{srcdir}/#{d}/*/").map {|n| n[(srcdir.size+1)..-2]}]
|
2017-01-26 11:19:34 +03:00
|
|
|
end
|
2017-01-23 05:50:23 +03:00
|
|
|
%>
|
2017-01-23 07:22:23 +03:00
|
|
|
MINIRUBY = <%=miniruby%>
|
|
|
|
SCRIPT_ARGS = <%=script_args%>
|
2017-01-28 08:02:41 +03:00
|
|
|
EXTMK_ARGS = $(SCRIPT_ARGS) --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \
|
2018-02-19 04:45:17 +03:00
|
|
|
--make-flags="MINIRUBY='$(MINIRUBY)'"
|
2017-01-26 11:19:34 +03:00
|
|
|
|
|
|
|
all: exts gems
|
|
|
|
exts:
|
|
|
|
gems:
|
2017-01-23 07:22:23 +03:00
|
|
|
|
2017-04-23 19:19:22 +03:00
|
|
|
% exts.each do |t, (o, dirs)|
|
|
|
|
% dirs.each do |d|
|
|
|
|
<%=t%>: <%=d%>/exts.mk
|
|
|
|
<%=d%>/exts.mk: FORCE
|
2017-01-26 11:19:34 +03:00
|
|
|
$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make='$(MAKE)' \
|
2017-04-23 19:19:22 +03:00
|
|
|
--command-output=$@ $(EXTMK_ARGS) <%=o%> \
|
2017-01-28 08:31:25 +03:00
|
|
|
-- configure $(@D)
|
2017-01-26 11:19:34 +03:00
|
|
|
% end
|
2017-01-23 05:50:23 +03:00
|
|
|
% end
|
|
|
|
|
2017-01-26 11:19:34 +03:00
|
|
|
.PHONY: FORCE all exts gems
|
2017-01-23 06:43:43 +03:00
|
|
|
FORCE:
|