summaryrefslogtreecommitdiff
path: root/tool/build-transcode
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 18:56:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-05 18:56:42 +0000
commit0031e09170af64ff0d6ad34cc7cfefbeb6df74f2 (patch)
tree487045b8ea4430a33660ccc6b3eeb78043a553c7 /tool/build-transcode
parent11d6d904249a2a3ad29806833b468801a43566af (diff)
* common.mk (transcodes), tool/build-transcode: generates transcode
sources. * enc/trans/{japanese,korean,single_byte,utf_16_32}.c: to be autogenerated now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/build-transcode')
-rwxr-xr-xtool/build-transcode18
1 files changed, 14 insertions, 4 deletions
diff --git a/tool/build-transcode b/tool/build-transcode
index 3093e49..69ffac2 100755
--- a/tool/build-transcode
+++ b/tool/build-transcode
@@ -1,6 +1,16 @@
#!/bin/sh
-ruby tool/transcode-tblgen.rb -vo enc/trans/single_byte.c enc/trans/single_byte.erb.c
-ruby tool/transcode-tblgen.rb -vo enc/trans/utf_16_32.c enc/trans/utf_16_32.erb.c
-ruby tool/transcode-tblgen.rb -vo enc/trans/japanese.c enc/trans/japanese.erb.c
-ruby tool/transcode-tblgen.rb -vo enc/trans/korean.c enc/trans/korean.erb.c
+[ "$1" -a -d "$1" ] && { cd "$1" || exit $?; } && shift
+[ "$#" = 0 ] && set enc/trans/*.erb.c
+for erb; do
+ case "$erb" in
+ *.erb.c)
+ src=`expr "$erb" | sed 's/\.erb\.c$/.c/'`
+ ${BASERUBY-ruby} tool/transcode-tblgen.rb -vo "$src" "$erb"
+ ;;
+ *)
+ echo "$0: don' know how to deal with $erb"
+ continue
+ ;;
+ esac
+done