ruby-changes:6951
From: nobu <ko1@a...>
Date: Sun, 10 Aug 2008 11:45:39 +0900 (JST)
Subject: [ruby-changes:6951] Ruby:r18469 (trunk): * enc/Makefile.in (make-workdir): use MAKEDIRS.
nobu 2008-08-10 11:45:18 +0900 (Sun, 10 Aug 2008) New Revision: 18469 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18469 Log: * enc/Makefile.in (make-workdir): use MAKEDIRS. * enc/depend: makes target directory before compile/link. * tool/transcode-tblgen.rb: creates target directory. Modified files: trunk/ChangeLog trunk/enc/Makefile.in trunk/enc/depend trunk/tool/transcode-tblgen.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 18468) +++ ChangeLog (revision 18469) @@ -1,3 +1,11 @@ +Sun Aug 10 11:45:15 2008 Nobuyoshi Nakada <nobu@r...> + + * enc/Makefile.in (make-workdir): use MAKEDIRS. + + * enc/depend: makes target directory before compile/link. + + * tool/transcode-tblgen.rb: creates target directory. + Sun Aug 10 11:30:48 2008 Tanaka Akira <akr@f...> * transcode.c: rename my_transcoding to tc and my_transcoder to tr. Index: enc/Makefile.in =================================================================== --- enc/Makefile.in (revision 18468) +++ enc/Makefile.in (revision 18469) @@ -46,13 +46,14 @@ WORKDIRS = $(ENCSODIR) $(TRANSSODIR) enc enc/trans RM = @RM@ +MAKEDIRS = @MAKEDIRS@ .SUFFIXES: .erb.c -all srcs: make-workdir +all: make-workdir make-workdir: - $(MINIRUBY) -run -e mkdir -- -p $(WORKDIRS) + $(MAKEDIRS) $(WORKDIRS) clean: Index: enc/depend =================================================================== --- enc/depend (revision 18468) +++ enc/depend (revision 18469) @@ -23,7 +23,7 @@ % cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "") % rule_subst = CONFIG["RULE_SUBST"] || "%s" % if File::ALT_SEPARATOR -% pathrep = proc {|path| path.gsub('/', File::ALT_SEPARATOR).gsub(/\$\((\w+)\)/, "$(\\1:/=\\#{File::ALT_SEPARATOR})")} +% pathrep = proc {|path| path.gsub('/', File::ALT_SEPARATOR).gsub(/\$\(([@<?*]\w?|\w+)\)/, "$(\\1:/=\\#{File::ALT_SEPARATOR})")} % else % pathrep = proc {|path| path} % end @@ -59,6 +59,7 @@ % end % compile_rules.each do |rule| <%= rule % %w[c $(OBJEXT)] %> + @$(MAKEDIRS) "$(@D)" <%=COMPILE_C%> % end @@ -89,6 +90,7 @@ echo EXPORTS > <%=df%> echo <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> >> <%=df%> % end + @$(MAKEDIRS) "$(@D)" <%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%> % end Index: tool/transcode-tblgen.rb =================================================================== --- tool/transcode-tblgen.rb (revision 18468) +++ tool/transcode-tblgen.rb (revision 18469) @@ -1,5 +1,6 @@ require 'optparse' require 'erb' +require 'fileutils' C_ESC = { "\\" => "\\\\", @@ -617,7 +618,8 @@ if output_filename new_filename = output_filename + ".new" - File.open(new_filename, "w") {|f| f << result } + FileUtils.mkdir_p(File.dirname(output_filename)) + File.open(new_filename, "wb") {|f| f << result } File.rename(new_filename, output_filename) STDERR.puts "done." if VERBOSE_MODE else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/