blob: dcdffb8baeb9ef1b5253f07a6aa4e22325288d2f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
! encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS
! encs.each {|e| e.chomp!(".c")}
! encs = encs.sort_by {|e| e.split(/(\d+)/).map {|n| Integer(n) rescue n}}
VPATH = <% %w[$(arch_hdrdir)/ruby $(hdrdir)/ruby $(top_srcdir) $(srcdir)].join(CONFIG["PATH_SEPARATOR"]) %>
LIBPATH = <%libpathflag($DEFLIBPATH)%>
ENCOBJS = <%encs.map {|e|"#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%"\n" if encs.size>1%>
ENCDEFS = <%encs.map {|e|"#{e}.def"}.join(" \\\n\t ") if DEFFILE%><%"\n" if encs.size>1%>
ENCSOS = <%encs.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%>
all: $(ENCSOS)
! COMPILE_RULES.each do |rule|
<% rule % %w[c $(OBJEXT)] %>
<%COMPILE_C%>
! end
! unless encs.empty?
$(ENCOBJS): regenc.h oniguruma.h config.h defines.h
! encs.each do |e|
<%e%>.so: $(ENCSODIR)/<%e%>.$(DLEXT)
! end
! end
! link_so = LINK_SO.gsub(/\n/, "\n\t")
! encs.each do |e|
! deps = "#{e}.$(OBJEXT)"
! deps << " #{e}-$(arch).def" if DEFFILE
$(ENCSODIR)/<%e%>.$(DLEXT): <%deps%>
<%link_so.sub(/\$\(OBJS\)/, deps)%>
! end
! if DEFFILE
! encs.each do |e|
<%e%>-$(arch).def: enc.mk
echo EXPORTS > $@
echo <%EXPORT_PREFIX%>Init_<%e%> >> $@
! end
! end
! encs.each do |e|
<%e%>.$(OBJEXT): <%e%>.c
! end
clean:
$(RM) $(ENCSOS)
$(RM) $(ENCDEFS)
$(RM) $(ENCOBJS)
distclean: clean
$(RM) enc.mk
|