1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/enc/depend
nobu 817a4e3c83 * common.mk (enc.mk): depends on $(RBCONFIG) instead of rbconfig.rb.
* encoding.c (Init_Encoding): ISO-8859-1 is no longer a replica.

* regenc.h (OnigEncodingDefine): names of extension and encoding can
  differ.

* enc/Makefile.in: always shared.

* enc/depend (deffile): should not upcase.

* enc/{ascii,euc_jp,sjis,utf8,iso_8859_{1..16}}.c: fix for Init.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21 02:23:26 +00:00

54 lines
1.3 KiB
Text

! 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