summaryrefslogtreecommitdiff
path: root/enc/depend
diff options
context:
space:
mode:
Diffstat (limited to 'enc/depend')
-rw-r--r--enc/depend27
1 files changed, 24 insertions, 3 deletions
diff --git a/enc/depend b/enc/depend
index f5eeafe..29ae915 100644
--- a/enc/depend
+++ b/enc/depend
@@ -3,23 +3,43 @@
! 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)
-.c.$(OBJEXT):
+! 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|
-$(ENCSODIR)/<%e%>.$(DLEXT): <%e%>.$(OBJEXT)
- <%LINK_SO.gsub(/\n/, "\n\t")%>
+! 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:
+ echo EXPORTS > $@
+ echo <%EXPORT_PREFIX%>Init_<%e.upcase%> >> $@
+! end
! end
! encs.each do |e|
<%e%>.$(OBJEXT): <%e%>.c
@@ -27,6 +47,7 @@ $(ENCSODIR)/<%e%>.$(DLEXT): <%e%>.$(OBJEXT)
clean:
$(RM) $(ENCSOS)
+ $(RM) $(ENCDEFS)
$(RM) $(ENCOBJS)
distclean: clean