diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 05:25:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-12 05:25:14 +0000 |
commit | 642df6dd2830805df4f3cf0c95c30a61ac7ce8b7 (patch) | |
tree | 06774f5de5985423eac6edc750b74022b1d56991 /enc/depend | |
parent | 4b1be99fd26f3cbf7f23acf7d6ebe9fefb56db2f (diff) | |
download | ruby-642df6dd2830805df4f3cf0c95c30a61ac7ce8b7.tar.gz ruby-642df6dd2830805df4f3cf0c95c30a61ac7ce8b7.tar.xz ruby-642df6dd2830805df4f3cf0c95c30a61ac7ce8b7.zip |
* enc/Makefile.in (.SUFFIXES): renamed to .trans.
* enc/make_encmake.rb: added --encs and --no-encs options.
* enc/depend (TRANSVPATH): fix for nmake.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enc/depend')
-rw-r--r-- | enc/depend | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/enc/depend b/enc/depend index 2eeb058d9..35cf6939b 100644 --- a/enc/depend +++ b/enc/depend @@ -1,6 +1,8 @@ % deffile = (true if /\$\(DEFFILE\)/ =~ CONFIG["LINK_SO"]) % encs = Dir.open($srcdir) {|d| d.grep(/.+\.c\z/)} - BUILTIN_ENCS % encs.each {|e| e.chomp!(".c")} +% encs.reject! {|e| !ENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} if !ENC_PATTERNS.empty? +% encs.reject! {|e| NOENC_PATTERNS.any? {|p| File.fnmatch?(p, e)}} % alphanumeric_order = proc {|e| e.scan(/(\d+)|(\D+)/).map {|n,a| a||[n.size,n.to_i]}.flatten} % encs = encs.sort_by(&alphanumeric_order) % encs.unshift(encs.delete("encdb")) @@ -19,11 +21,14 @@ % atrans = atrans.sort_by(&alphanumeric_order) % trans = trans.sort_by(&alphanumeric_order) % trans.unshift(trans.delete("transdb")) +% trans |= atrans % trans.map! {|e| "trans/#{e}"} % dependencies = encs + trans % cleanlibs = Shellwords.shellwords(CONFIG["cleanlibs"] || "") % cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "") % rule_subst = CONFIG["RULE_SUBST"] || "%s" +% transvpath = rule_subst.dup.sub!(/\{[^{}]+\}/, '$(TRANSVPATH)/') || "enc/trans/%s" +% transvpath_prefix = rule_subst.dup.sub!(/\{[^{}]+\}/, '{$(TRANSVPATH)}') || "" % if File::ALT_SEPARATOR % pathrep = proc {|path| path.gsub('/', File::ALT_SEPARATOR).gsub(/\$\(([@<?*]\w?|\w+)\)/, "$(\\1:/=\\#{File::ALT_SEPARATOR})")} % else @@ -42,7 +47,9 @@ ENCCLEANOBJS = <%=cleanobjs.map {|clean| clean.gsub(/\$\*(\.\w+)?/) {"$(ENCOBJS#{$1 ? ":.#{CONFIG["OBJEXT"]}=#{$1}" : ""})"} }.join(" ")%> -TRANSCSRCS = <%=atrans.map {|e| rule_subst % "enc/trans/#{e}.c"}.join(" \\\n\t ")%><%="\n" if trans.size>1%> +TRANSVPATH = $(srcdir)/enc/trans + +TRANSCSRCS = <%=atrans.map {|e| transvpath % "#{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%> TRANSSOS = <%=trans.map {|e|"$(ENCSODIR)/#{e}.$(DLEXT)"}.join(" \\\n\t ")%><%="\n" if trans.size>1%> TRANSCLEANLIBS = <%=cleanlibs.map {|clean| @@ -61,10 +68,14 @@ srcs: $(TRANSCSRCS) % end % compile_rules.each do |rule| <%= rule % %w[c $(OBJEXT)] %> - @$(MAKEDIRS) "$(@D)" + -@$(MAKEDIRS) "$(@D)" <%=COMPILE_C%> % end + +<%=transvpath_prefix%>.trans<%=transvpath_prefix%>.c: + $(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" "$<" + % unless encs.empty? or trans.empty? % unless encs.empty? @@ -75,10 +86,10 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma. % end % atrans.each do |e| % src = "#{e}.trans" -% src = [src, *IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}] -<%=rule_subst % "enc/trans/#{e}.c"%>: <%= src.map {|e| rule_subst % "enc/trans/#{e}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb - $(MINIRUBY) "$(srcdir)/tool/transcode-tblgen.rb" -vo "$@" <%= src.map {|e| %'"$(srcdir)/enc/trans/#{e}"'}.join(" ")%> +<%=transvpath % "#{e}.c"%>: <%= transvpath % "#{e}.trans"%> +% src = [*IO.read(File.join($srcdir, "trans", src)).scan(/^\s*require\s+[\'\"]([^\'\"]*)/).flatten.map{|c|c+".rb"}] +<%=transvpath % "#{e}.c"%>: <%= src.map {|e| transvpath % "#{e}"}.join(" ")%> $(srcdir)/tool/transcode-tblgen.rb % end % end @@ -89,8 +100,8 @@ $(TRANSOBJS): ruby.h intern.h config.h defines.h missing.h encoding.h oniguruma. % df = ("enc/#{e}.def" if deffile) $(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%> % if df - echo EXPORTS > <%=df%> - echo <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> >> <%=df%> + echo> <%=df%> EXPORTS + echo>> <%=df%> <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> % end @$(MAKEDIRS) "$(@D)" <%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%> |