mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2c78899641
(BUILTIN_TRANSOBJS): defined. * enc/Makefile.in (BUILTIN_TRANSES): defined. * enc/make_encmake.rb (BUILTIN_TRANSES): defined. * enc/depend: don't generate rules for builtin transcoders. * common.mk (COMMONOBJS): add BUILTIN_TRANSOBJS. (enc.mk): pass BUILTIN_TRANSOBJS. (newline.c): new rule. (newline.$(OBJEXT)): new ru.e (srcs): newline.c added. * Makefile.in (BUILTIN_TRANSSRCS): defined. (BUILTIN_TRANSOBJS): defined. * transcode.c (Init_transcode): call Init_newline. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
50 lines
1.1 KiB
Ruby
50 lines
1.1 KiB
Ruby
#! ./miniruby
|
|
|
|
dir = File.expand_path("../..", __FILE__)
|
|
$:.unshift(dir)
|
|
$:.unshift(".")
|
|
if $".grep(/mkmf/).empty?
|
|
$" << "mkmf.rb"
|
|
load File.expand_path("lib/mkmf.rb", dir)
|
|
end
|
|
require 'erb'
|
|
|
|
CONFIG["MAKEDIRS"] ||= '@$(MINIRUBY) -run -e mkdir -- -p'
|
|
|
|
BUILTIN_ENCS = []
|
|
BUILTIN_TRANSES = []
|
|
ENC_PATTERNS = []
|
|
NOENC_PATTERNS = []
|
|
|
|
until ARGV.empty?
|
|
case ARGV[0]
|
|
when /\A--builtin-encs=/
|
|
BUILTIN_ENCS.concat $'.split.map {|e| File.basename(e, '.*') << '.c'}
|
|
ARGV.shift
|
|
when /\A--builtin-transes=/
|
|
BUILTIN_TRANSES.concat $'.split.map {|e| File.basename(e, '.*') }
|
|
ARGV.shift
|
|
when /\A--encs=/
|
|
ENC_PATTERNS.concat $'.split
|
|
ARGV.shift
|
|
when /\A--no-encs=/
|
|
NOENC_PATTERNS.concat $'.split
|
|
ARGV.shift
|
|
else
|
|
break
|
|
end
|
|
end
|
|
|
|
if File.exist?(depend = File.join($srcdir, "depend"))
|
|
erb = ERB.new(File.read(depend), nil, '%')
|
|
erb.filename = depend
|
|
tmp = erb.result(binding)
|
|
dep = "\n#### depend ####\n\n" << depend_rules(tmp).join
|
|
else
|
|
dep = ""
|
|
end
|
|
mkin = File.read(File.join($srcdir, "Makefile.in"))
|
|
mkin.gsub!(/@(#{CONFIG.keys.join('|')})@/) {CONFIG[$1]}
|
|
open(ARGV[0], 'wb') {|f|
|
|
f.puts mkin, dep
|
|
}
|