blob: 785896e1a824ed9f5b7fe6d605f03418fb0ea18d [file] [log] [blame]
Daniel Stenberg7728c942008-10-14 20:44:49 +00001#!/usr/bin/perl
2
Franklin Wei54e7eaf2019-10-28 00:54:52 -04003$version="3.15";
Daniel Stenberg7728c942008-10-14 20:44:49 +00004
Frank Gevaerts85929242010-06-03 20:50:07 +00005require "tools/builds.pm";
6
Daniel Stenberg7728c942008-10-14 20:44:49 +00007my $verbose;
8if($ARGV[0] eq "-v") {
9 $verbose =1;
10 shift @ARGV;
11}
12
13my $doonly;
14if($ARGV[0]) {
15 $doonly = $ARGV[0];
16 print "only build $doonly\n" if($verbose);
17}
18
19# made once for all targets
20sub runone {
Björn Stenbergc0740442009-12-07 12:19:08 +000021 my ($dir)=@_;
Daniel Stenberg7728c942008-10-14 20:44:49 +000022 my $a;
23
24 if($doonly && ($doonly ne $dir)) {
25 return;
26 }
27
Daniel Stenberg32707952009-06-18 22:08:12 +000028 mkdir "buildv-$dir";
29 chdir "buildv-$dir";
30 print "Build in buildv-$dir\n" if($verbose);
Daniel Stenberg7728c942008-10-14 20:44:49 +000031
32 # build the manual(s)
Björn Stenbergc0740442009-12-07 12:19:08 +000033 $a = buildit($dir);
Daniel Stenberg7728c942008-10-14 20:44:49 +000034
35 chdir "..";
36
Daniel Stenberg32707952009-06-18 22:08:12 +000037 my $o="buildv-$dir/english.voice";
Daniel Stenberg7728c942008-10-14 20:44:49 +000038 if (-f $o) {
39 my $newo="output/$dir-$version-english.zip";
40 system("cp $o output/$dir-$version-english.voice");
41 system("mkdir -p .rockbox/langs");
42 system("cp $o .rockbox/langs");
43 system("zip -r $newo .rockbox");
44 system("rm -rf .rockbox");
45 print "moved $o to $newo\n" if($verbose);
46 }
47
Daniel Stenberg32707952009-06-18 22:08:12 +000048 print "remove all contents in buildv-$dir\n" if($verbose);
49 system("rm -rf buildv-$dir");
Daniel Stenberg7728c942008-10-14 20:44:49 +000050
51 return $a;
52};
53
54sub buildit {
Björn Stenbergc0740442009-12-07 12:19:08 +000055 my ($model)=@_;
Daniel Stenberg7728c942008-10-14 20:44:49 +000056
57 `rm -rf * >/dev/null 2>&1`;
58
Frank Gevaertsbf17fcb2010-06-03 21:04:02 +000059 my $c = "../tools/configure --type=av --target=$model --language=0 --tts=f --ram=0 --voice=0";
Daniel Stenberg7728c942008-10-14 20:44:49 +000060
61 print "C: $c\n" if($verbose);
62 `$c`;
63
64 print "Run 'make voice'\n" if($verbose);
Frank Gevaertsd0731062011-12-07 17:59:11 +000065 print `make voice VERSION=$version 2>/dev/null`;
Daniel Stenberg7728c942008-10-14 20:44:49 +000066}
67
68# run make in tools first to make sure they're up-to-date
69`(cd tools && make ) >/dev/null 2>&1`;
70
Daniel Stenberg32707952009-06-18 22:08:12 +000071my $home=$ENV{'HOME'};
72
73my $pool="$home/tmp/rockbox-voices-$version/voice-pool";
74`mkdir -p $pool`;
75`rm -f $pool/*`;
76$ENV{'POOL'}="$pool";
Daniel Stenberg7728c942008-10-14 20:44:49 +000077
Björn Stenbergc0740442009-12-07 12:19:08 +000078for my $b (&stablebuilds) {
Frank Gevaerts211e54c2010-06-03 20:56:24 +000079 next if (length($builds{$b}{configname}) > 0); # no variants
Daniel Stenberg7728c942008-10-14 20:44:49 +000080
Björn Stenbergc0740442009-12-07 12:19:08 +000081 runone($b);
82}