Move firmware/target/sdl under firmware/target/hosted
[kugel-rb.git] / tools / release / voices.pl
bloba5349618bb58984631e9aaea8bdcc0d6f5958208
1 #!/usr/bin/perl
3 $version="3.0";
5 my $verbose;
6 if($ARGV[0] eq "-v") {
7 $verbose =1;
8 shift @ARGV;
11 my $doonly;
12 if($ARGV[0]) {
13 $doonly = $ARGV[0];
14 print "only build $doonly\n" if($verbose);
17 # made once for all targets
18 sub runone {
19 my ($dir)=@_;
20 my $a;
22 if($doonly && ($doonly ne $dir)) {
23 return;
26 mkdir "buildv-$dir";
27 chdir "buildv-$dir";
28 print "Build in buildv-$dir\n" if($verbose);
30 # build the manual(s)
31 $a = buildit($dir);
33 chdir "..";
35 my $o="buildv-$dir/english.voice";
36 if (-f $o) {
37 my $newo="output/$dir-$version-english.zip";
38 system("cp $o output/$dir-$version-english.voice");
39 system("mkdir -p .rockbox/langs");
40 system("cp $o .rockbox/langs");
41 system("zip -r $newo .rockbox");
42 system("rm -rf .rockbox");
43 print "moved $o to $newo\n" if($verbose);
46 print "remove all contents in buildv-$dir\n" if($verbose);
47 system("rm -rf buildv-$dir");
49 return $a;
52 sub buildit {
53 my ($model)=@_;
55 `rm -rf * >/dev/null 2>&1`;
57 my $c = "../tools/configure --type=av --target=$model --language=0 --tts=f";
59 print "C: $c\n" if($verbose);
60 `$c`;
62 print "Run 'make voice'\n" if($verbose);
63 print `make voice 2>/dev/null`;
66 # run make in tools first to make sure they're up-to-date
67 `(cd tools && make ) >/dev/null 2>&1`;
69 my $home=$ENV{'HOME'};
71 my $pool="$home/tmp/rockbox-voices-$version/voice-pool";
72 `mkdir -p $pool`;
73 `rm -f $pool/*`;
74 $ENV{'POOL'}="$pool";
76 for my $b (&stablebuilds) {
77 next if ($builds{$b}{configname} < 3); # no variants
79 runone($b);