2007-12-19 12:23:24 -05:00
|
|
|
! 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}}
|
2007-12-17 11:15:46 -05:00
|
|
|
|
|
|
|
VPATH = <% %w[$(arch_hdrdir)/ruby $(hdrdir)/ruby $(top_srcdir) $(srcdir)].join(CONFIG["PATH_SEPARATOR"]) %>
|
2007-12-20 03:07:56 -05:00
|
|
|
LIBPATH = <%libpathflag($DEFLIBPATH)%>
|
2007-12-17 11:15:46 -05:00
|
|
|
|
2007-12-18 00:05:25 -05:00
|
|
|
ENCOBJS = <%encs.map {|e|"#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%"\n" if encs.size>1%>
|
2007-12-20 03:07:56 -05:00
|
|
|
ENCDEFS = <%encs.map {|e|"#{e}.def"}.join(" \\\n\t ") if DEFFILE%><%"\n" if encs.size>1%>
|
2007-12-18 00:05:25 -05:00
|
|
|
ENCSOS = <%encs.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%>
|
2007-12-17 11:15:46 -05:00
|
|
|
|
2007-12-17 03:19:29 -05:00
|
|
|
all: $(ENCSOS)
|
|
|
|
|
2007-12-20 03:07:56 -05:00
|
|
|
! COMPILE_RULES.each do |rule|
|
|
|
|
<% rule % %w[c $(OBJEXT)] %>
|
2007-12-17 11:15:46 -05:00
|
|
|
<%COMPILE_C%>
|
2007-12-20 03:07:56 -05:00
|
|
|
|
|
|
|
! end
|
2007-12-18 00:05:25 -05:00
|
|
|
! unless encs.empty?
|
2007-12-17 11:15:46 -05:00
|
|
|
|
2007-12-17 03:19:29 -05:00
|
|
|
$(ENCOBJS): regenc.h oniguruma.h config.h defines.h
|
2007-12-17 11:15:46 -05:00
|
|
|
|
2007-12-20 03:07:56 -05:00
|
|
|
! encs.each do |e|
|
|
|
|
<%e%>.so: $(ENCSODIR)/<%e%>.$(DLEXT)
|
2007-12-18 00:05:25 -05:00
|
|
|
! end
|
2007-12-20 03:07:56 -05:00
|
|
|
|
|
|
|
! end
|
|
|
|
! link_so = LINK_SO.gsub(/\n/, "\n\t")
|
2007-12-17 11:15:46 -05:00
|
|
|
! encs.each do |e|
|
2007-12-20 03:07:56 -05:00
|
|
|
! 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|
|
2007-12-20 21:23:26 -05:00
|
|
|
<%e%>-$(arch).def: enc.mk
|
2007-12-20 03:07:56 -05:00
|
|
|
echo EXPORTS > $@
|
2007-12-20 21:23:26 -05:00
|
|
|
echo <%EXPORT_PREFIX%>Init_<%e%> >> $@
|
2007-12-17 11:15:46 -05:00
|
|
|
|
2007-12-20 03:07:56 -05:00
|
|
|
! end
|
2007-12-18 00:05:25 -05:00
|
|
|
! end
|
2007-12-17 11:15:46 -05:00
|
|
|
! encs.each do |e|
|
|
|
|
<%e%>.$(OBJEXT): <%e%>.c
|
|
|
|
! end
|
2007-12-19 12:23:24 -05:00
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) $(ENCSOS)
|
2007-12-20 03:07:56 -05:00
|
|
|
$(RM) $(ENCDEFS)
|
2007-12-19 12:23:24 -05:00
|
|
|
$(RM) $(ENCOBJS)
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(RM) enc.mk
|