* common.mk (transdb.h): requires transcoders.

* enc/depend (srcs): target for transcoders.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-06 05:40:13 +00:00
Родитель ce074dcf42
Коммит 8db17b30d6
4 изменённых файлов: 15 добавлений и 7 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Wed Aug 6 14:40:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (transdb.h): requires transcoders.
* enc/depend (srcs): target for transcoders.
Wed Aug 6 14:04:08 2008 NAKAMURA Usaku <usa@ruby-lang.org>
* enc/depend: replace not only $(<:...) but also $<.

Просмотреть файл

@ -673,8 +673,8 @@ vm.inc: $(srcdir)/template/vm.inc.tmpl
srcs: {$(VPATH)}parse.c {$(VPATH)}lex.c $(srcdir)/ext/ripper/ripper.c transcodes
transcodes:
$(srcdir)/tool/build-transcode "$(srcdir)"
transcodes: enc.mk
$(MAKE) -f enc.mk RUBY="$(MINIRUBY)" MINIRUBY="$(MINIRUBY)" $(MFLAGS) srcs
incs: $(INSNS) {$(VPATH)}node_name.inc {$(VPATH)}encdb.h {$(VPATH)}transdb.h $(srcdir)/revision.h
@ -687,7 +687,7 @@ encdb.h: $(PREP)
$(MINIRUBY) $(srcdir)/enc/make_encdb.rb $(srcdir)/enc $@.new
$(IFCHANGE) "$@" "$@.new"
transdb.h: $(PREP)
transdb.h: $(PREP) transcodes
$(MINIRUBY) $(srcdir)/enc/trans/make_transdb.rb $(srcdir)/enc/trans $@.new
$(IFCHANGE) "$@" "$@.new"

Просмотреть файл

@ -25,11 +25,14 @@ ENCOBJS = <%=encs.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if en
ENCDEFS = <%=encs.map {|e|"enc/#{e}.def"}.join(" \\\n\t ") if deffile%><%="\n" if encs.size>1%>
ENCSOS = <%=encs.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%>
TRANSCSRCS = <%=atrans.map {|e|"enc/trans/#{e}.c"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
TRANSOBJS = <%=trans.map {|e|"enc/#{e}.$(OBJEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%>
TRANSDEFS = <%=trans.map {|e|"enc/#{e}.def"}.join(" \\\n\t ") if deffile%><%="\n" if trans.size>1%>
TRANSSOS = <%=trans.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%>
all: $(ENCSOS) $(TRANSSOS)
all: srcs $(ENCSOS) $(TRANSSOS)
srcs: $(TRANSCSRCS)
% COMPILE_RULES.each do |rule|
<%= rule % %w[c $(OBJEXT)] %>
@ -46,7 +49,7 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.
% end
% atrans.each do |e|
% src = "#{e}.erb.c"
% src = [src, *IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|e|e+".rb"}]
% src = [src, *IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}]
$(srcdir)/enc/trans/<%=e%>.c: <%= src.map {|e| "$(srcdir)/enc/trans/#{e}"}.join(" ")%>
$(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" <%= src.map {|e| %'"$(srcdir)/enc/trans/#{e}"'}.join(" ")%>
@ -75,7 +78,7 @@ enc/encdb.$(OBJEXT): encdb.h
enc/trans/transdb.$(OBJEXT): transdb.h
clean:
@$(RM) $(ENCSOS) $(ENCDEFS) $(ENCOBJS) $(TRANSSOS) $(TRANSDEFS) $(TRANSOBJS)
@$(RM) $(ENCSOS) $(ENCDEFS) $(ENCOBJS) $(TRANSSOS) $(TRANSDEFS) $(TRANSOBJS) $(TRANSCSRCS)
% %w[$(ENCSODIR)/trans $(ENCSODIR) enc/trans enc].each do|dir|
% dir = dir.gsub('/', File::ALT_SEPARATOR) if File::ALT_SEPARATOR
@-rmdir <%=dir%>

Просмотреть файл

@ -18,7 +18,6 @@ Dir.open(transdir) {|d| d.grep(/.+\.[ch]\z/).reject {|n| /\.erb\.c\z/ =~ n }}.so
if (/^static const rb_transcoder/ =~ line)..(/"(.*?)"\s*,\s*"(.*?)"/ =~ line)
if $1 && $2
from_to = "%s to %s" % [$1, $2]
converters[from_to]
if converters[from_to]
raise ArgumentError, '%s:%d: transcode "%s" is already registered (%s:%d)' %
[fn, $., from_to, *converters[from_to].values_at(2, 3)]