From 82e89f1237212ea06c05f10334425b3c3ed3d3b3 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 5 Aug 2008 18:15:52 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ enc/Makefile.in | 3 +++ enc/depend | 19 ++++++++++++++++++- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5b44b4ab19..5dcc4e9c92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Wed Aug 6 03:15:49 2008 Nobuyoshi Nakada + + * enc/depend: added rules for .c from .erb.c. + Tue Aug 5 20:46:20 2008 Tanaka Akira * tool/build-transcode: new file. diff --git a/enc/Makefile.in b/enc/Makefile.in index 436c0f4e32..488e0b8a6f 100644 --- a/enc/Makefile.in +++ b/enc/Makefile.in @@ -42,9 +42,12 @@ ldflags = $(LDFLAGS) dldflags = @DLDFLAGS@ archflag = @ARCH_FLAG@ DLDFLAGS = $(ldflags) $(dldflags) $(archflag) +BASERUBY = @BASERUBY@ RM = @RM@ +.SUFFIXES: .erb.c + all: clean: diff --git a/enc/depend b/enc/depend index 0c15b12344..5759bd3e55 100644 --- a/enc/depend +++ b/enc/depend @@ -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")