summaryrefslogtreecommitdiffstats
path: root/enc/make_encmake.rb
diff options
context:
space:
mode:
Diffstat (limited to 'enc/make_encmake.rb')
-rw-r--r--enc/make_encmake.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb
index 799c4a085..7b0314985 100644
--- a/enc/make_encmake.rb
+++ b/enc/make_encmake.rb
@@ -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|