* enc/depend: added rules for .c from .erb.c.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-08-05 18:15:52 +00:00
parent f694ec83e8
commit 82e89f1237
3 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,7 @@
Wed Aug 6 03:15:49 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* enc/depend: added rules for .c from .erb.c.
Tue Aug 5 20:46:20 2008 Tanaka Akira <akr@fsij.org>
* tool/build-transcode: new file.

View File

@ -42,9 +42,12 @@ ldflags = $(LDFLAGS)
dldflags = @DLDFLAGS@
archflag = @ARCH_FLAG@
DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
BASERUBY = @BASERUBY@
RM = @RM@
.SUFFIXES: .erb.c
all:
clean:

View File

@ -3,7 +3,17 @@
% encs.each {|e| e.chomp!(".c")}
% alphanumeric_order = proc {|e| e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten}
% encs = encs.sort_by(&alphanumeric_order)
% trans = Dir.open($srcdir+"/trans") {|d| d.select {|e| e.chomp!('.c') && /\.erb\z/ !~ e }}
% atrans = []
% trans = Dir.open($srcdir+"/trans") {|d|
% d.select {|e|
% if e.chomp!('.c')
% atrans << e if e.chomp!(".erb")
% true
% end
% }
% }
% trans.uniq!
% atrans = atrans.sort_by(&alphanumeric_order)
% trans = trans.sort_by(&alphanumeric_order)
% trans.map! {|e| "trans/#{e}"}
% dependencies = encs + trans
@ -34,6 +44,13 @@ $(ENCOBJS): regenc.h oniguruma.h config.h defines.h
% unless trans.empty?
$(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma.h st.h transcode_data.h
% 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"}]
$(srcdir)/enc/trans/<%=e%>.c: <%= src.map {|e| "$(srcdir)/enc/trans/#{e}"}.join(" ")%>
$(BASERUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<"
% end
% end
% link_so = LINK_SO.gsub(/\n/, "\n\t")