mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	* enc/depend, enc/make_encmake.rb: use erb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14503 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									872899fa58
								
							
						
					
					
						commit
						cd42707d86
					
				
					 3 changed files with 41 additions and 38 deletions
				
			
		| 
						 | 
				
			
			@ -5,10 +5,10 @@ $:.unshift(File.join(dir, "lib"))
 | 
			
		|||
$:.unshift(dir)
 | 
			
		||||
$:.unshift(".")
 | 
			
		||||
require 'mkmf'
 | 
			
		||||
require 'tool/serb'
 | 
			
		||||
require 'erb'
 | 
			
		||||
 | 
			
		||||
if /--builtin-encs=/ =~ ARGV[0]
 | 
			
		||||
  BUILTIN_ENCS = $'.split.each {|e| e.sub!(/(?:\.\w+)?\z/, '.c')}
 | 
			
		||||
  BUILTIN_ENCS = $'.split.map {|e| File.basename(e, '.*') << '.c'}
 | 
			
		||||
  ARGV.shift
 | 
			
		||||
else
 | 
			
		||||
  BUILTIN_ENCS = []
 | 
			
		||||
| 
						 | 
				
			
			@ -19,8 +19,9 @@ DEFFILE = (true if CONFIG["DLDFLAGS"].sub!(/\s+-def:\$\(DEFFILE\)\s+/, ' '))
 | 
			
		|||
mkin = File.read(File.join($srcdir, "Makefile.in"))
 | 
			
		||||
mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
 | 
			
		||||
if File.exist?(depend = File.join($srcdir, "depend"))
 | 
			
		||||
  tmp = ''
 | 
			
		||||
  eval(serb(File.read(depend), 'tmp'), binding, depend)
 | 
			
		||||
  erb = ERB.new(File.read(depend), nil, '%')
 | 
			
		||||
  erb.filename = depend
 | 
			
		||||
  tmp = erb.result(binding)
 | 
			
		||||
  mkin << "\n#### depend ####\n\n" << depend_rules(tmp).join
 | 
			
		||||
end
 | 
			
		||||
open(ARGV[0], 'wb') {|f|
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue