diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-10 02:45:18 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-10 02:45:18 +0000 |
commit | 6e98c4b74143634816be17759f5a50b5ba7a9e4b (patch) | |
tree | ae214bcbccf8f2993c7f5ef5c233620083188538 | |
parent | a4b56b5eeddcc8733f04b34244d098945badaf04 (diff) | |
download | ruby-6e98c4b74143634816be17759f5a50b5ba7a9e4b.tar.gz ruby-6e98c4b74143634816be17759f5a50b5ba7a9e4b.tar.xz ruby-6e98c4b74143634816be17759f5a50b5ba7a9e4b.zip |
* enc/Makefile.in (make-workdir): use MAKEDIRS.
* enc/depend: makes target directory before compile/link.
* tool/transcode-tblgen.rb: creates target directory.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | enc/Makefile.in | 5 | ||||
-rw-r--r-- | enc/depend | 4 | ||||
-rw-r--r-- | tool/transcode-tblgen.rb | 4 |
4 files changed, 17 insertions, 4 deletions
@@ -1,3 +1,11 @@ +Sun Aug 10 11:45:15 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@fsij.org> * transcode.c: rename my_transcoding to tc and my_transcoder to tr. diff --git a/enc/Makefile.in b/enc/Makefile.in index 103ad6b9a..cc3d99d39 100644 --- a/enc/Makefile.in +++ b/enc/Makefile.in @@ -46,13 +46,14 @@ DLDFLAGS = $(ldflags) $(dldflags) $(archflag) 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: diff --git a/enc/depend b/enc/depend index a18df490e..d41389868 100644 --- a/enc/depend +++ b/enc/depend @@ -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 @@ srcs: $(TRANSCSRCS) % end % compile_rules.each do |rule| <%= rule % %w[c $(OBJEXT)] %> + @$(MAKEDIRS) "$(@D)" <%=COMPILE_C%> % end @@ -89,6 +90,7 @@ $(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%> 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 diff --git a/tool/transcode-tblgen.rb b/tool/transcode-tblgen.rb index 119fa0d1c..4e7cbc516 100644 --- a/tool/transcode-tblgen.rb +++ b/tool/transcode-tblgen.rb @@ -1,5 +1,6 @@ require 'optparse' require 'erb' +require 'fileutils' C_ESC = { "\\" => "\\\\", @@ -617,7 +618,8 @@ result << "\n" 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 |