3 # quick, very dirty little script so that we can put all the
4 # information for building a floor book set in one spec file.
9 # =44c0_s 44c1_s 44c2_s
10 # build line_128x4_class0 0-256
11 # build line_128x4_0sub0 0-4
13 die "Could not open $ARGV[0]: $!" unless open (F
,$ARGV[0]);
25 if($line=~m/\S+/ && !($line=~m/^\#/) ){
28 die "Couldn't shell command.\n\tcommand:$command\n"
35 # this sets the output bookset file name
36 if($line=~m/^>(\S+)\s+(\S*)/){
40 $command="rm -f $globalname.vqh";
41 die "Couldn't remove file.\n\tcommand:$command\n"
48 #set the search path for input files; each build line will look
49 #for input files in all of the directories in the search path and
50 #append them for huffbuild input
57 # build book.vqd 0-3 [noguard]
58 if($line=~m/^build (.*)/){
59 # build a huffman book (no mapping)
60 my($datafile,$range,$guard)=split(' ',$1);
62 $command="rm -f $datafile.tmp";
63 print "\n\n>>> $command\n";
64 die "Couldn't remove temp file.\n\tcommand:$command\n"
67 # first find all the inputs we want; they'll need to be collected into a single input file
68 foreach $dir (@paths){
69 if (-e
"$dir/$datafile.vqd"){
70 $command="cat $dir/$datafile.vqd >> $datafile.tmp";
71 print ">>> $command\n";
72 die "Couldn't append training data.\n\tcommand:$command\n"
77 my $command="huffbuild $datafile.tmp $range $guard";
78 print ">>> $command\n";
79 die "Couldn't build huffbook.\n\tcommand:$command\n"
82 $command="cat $datafile.vqh >> $globalname.vqh";
83 print ">>> $command\n";
84 die "Couldn't append to output book.\n\tcommand:$command\n"
87 $command="rm $datafile.vqh";
88 print ">>> $command\n";
89 die "Couldn't remove temporary output file.\n\tcommand:$command\n"
92 $command="rm -f $datafile.tmp";
93 print ">>> $command\n";
94 die "Couldn't remove temporary output file.\n\tcommand:$command\n"
101 $command="rm -f temp$$.vqd";
102 print ">>> $command\n";
103 die "Couldn't remove temp files.\n\tcommand:$command\n"