зеркало из https://github.com/github/ruby.git
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
2ce7aeca6e
Коммит
e3d9fc76e6
|
@ -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>
|
Sun Aug 10 11:30:48 2008 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* transcode.c: rename my_transcoding to tc and my_transcoder to tr.
|
* transcode.c: rename my_transcoding to tc and my_transcoder to tr.
|
||||||
|
|
|
@ -46,13 +46,14 @@ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
|
||||||
WORKDIRS = $(ENCSODIR) $(TRANSSODIR) enc enc/trans
|
WORKDIRS = $(ENCSODIR) $(TRANSSODIR) enc enc/trans
|
||||||
|
|
||||||
RM = @RM@
|
RM = @RM@
|
||||||
|
MAKEDIRS = @MAKEDIRS@
|
||||||
|
|
||||||
.SUFFIXES: .erb.c
|
.SUFFIXES: .erb.c
|
||||||
|
|
||||||
all srcs: make-workdir
|
all: make-workdir
|
||||||
|
|
||||||
make-workdir:
|
make-workdir:
|
||||||
$(MINIRUBY) -run -e mkdir -- -p $(WORKDIRS)
|
$(MAKEDIRS) $(WORKDIRS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
% cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "")
|
% cleanobjs = Shellwords.shellwords(CONFIG["cleanobjs"] || "")
|
||||||
% rule_subst = CONFIG["RULE_SUBST"] || "%s"
|
% rule_subst = CONFIG["RULE_SUBST"] || "%s"
|
||||||
% if File::ALT_SEPARATOR
|
% 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
|
% else
|
||||||
% pathrep = proc {|path| path}
|
% pathrep = proc {|path| path}
|
||||||
% end
|
% end
|
||||||
|
@ -59,6 +59,7 @@ srcs: $(TRANSCSRCS)
|
||||||
% end
|
% end
|
||||||
% compile_rules.each do |rule|
|
% compile_rules.each do |rule|
|
||||||
<%= rule % %w[c $(OBJEXT)] %>
|
<%= rule % %w[c $(OBJEXT)] %>
|
||||||
|
@$(MAKEDIRS) "$(@D)"
|
||||||
<%=COMPILE_C%>
|
<%=COMPILE_C%>
|
||||||
|
|
||||||
% end
|
% end
|
||||||
|
@ -89,6 +90,7 @@ $(ENCSODIR)/<%=e%>.$(DLEXT): <%=obj%>
|
||||||
echo EXPORTS > <%=df%>
|
echo EXPORTS > <%=df%>
|
||||||
echo <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> >> <%=df%>
|
echo <%=EXPORT_PREFIX%>Init_<%=File.basename(e)%> >> <%=df%>
|
||||||
% end
|
% end
|
||||||
|
@$(MAKEDIRS) "$(@D)"
|
||||||
<%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%>
|
<%=link_so.sub(/\$\(OBJS\)/) {obj}.sub(/\$\(DEFFILE\)/) {df}.gsub(/-(?:implib|pdb):/) {|s|"#{s}enc/#{e.sub(/[^\/]+\z/, '')}"}%>
|
||||||
|
|
||||||
% end
|
% end
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
require 'optparse'
|
require 'optparse'
|
||||||
require 'erb'
|
require 'erb'
|
||||||
|
require 'fileutils'
|
||||||
|
|
||||||
C_ESC = {
|
C_ESC = {
|
||||||
"\\" => "\\\\",
|
"\\" => "\\\\",
|
||||||
|
@ -617,7 +618,8 @@ result << "\n"
|
||||||
|
|
||||||
if output_filename
|
if output_filename
|
||||||
new_filename = output_filename + ".new"
|
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)
|
File.rename(new_filename, output_filename)
|
||||||
STDERR.puts "done." if VERBOSE_MODE
|
STDERR.puts "done." if VERBOSE_MODE
|
||||||
else
|
else
|
||||||
|
|
Загрузка…
Ссылка в новой задаче