2008-10-14 20:44:49 +00:00
|
|
|
#!/usr/bin/perl
|
2012-04-07 18:29:59 +00:00
|
|
|
$version="3.11.1";
|
2008-10-14 20:44:49 +00:00
|
|
|
|
2010-01-27 08:52:55 +00:00
|
|
|
require "tools/builds.pm";
|
2008-10-14 20:44:49 +00:00
|
|
|
|
|
|
|
my $verbose;
|
|
|
|
if($ARGV[0] eq "-v") {
|
|
|
|
$verbose =1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $update;
|
|
|
|
if($ARGV[0] eq "-u") {
|
|
|
|
$update =1;
|
|
|
|
shift @ARGV;
|
|
|
|
}
|
|
|
|
|
|
|
|
my $doonly;
|
|
|
|
if($ARGV[0]) {
|
|
|
|
$doonly = $ARGV[0];
|
|
|
|
print "only build $doonly\n" if($verbose);
|
|
|
|
}
|
|
|
|
|
|
|
|
if($update) {
|
|
|
|
# svn update!
|
|
|
|
system("svn -q up");
|
|
|
|
}
|
|
|
|
|
|
|
|
$rev = `svnversion`;
|
|
|
|
chomp $rev;
|
|
|
|
print "rev $rev\n" if($verbose);
|
|
|
|
|
|
|
|
# made once for all targets
|
|
|
|
sub runone {
|
|
|
|
my ($dir, $confnum, $extra)=@_;
|
|
|
|
my $a;
|
|
|
|
|
|
|
|
if($doonly && ($doonly ne $dir)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir "build-$dir";
|
|
|
|
chdir "build-$dir";
|
|
|
|
print "Build in build-$dir\n" if($verbose);
|
|
|
|
|
|
|
|
# build the manual(s)
|
|
|
|
$a = buildit($dir, $confnum, $extra);
|
|
|
|
|
|
|
|
chdir "..";
|
|
|
|
|
|
|
|
my $o="build-$dir/rockbox.zip";
|
2011-02-20 19:27:09 +00:00
|
|
|
my $map="build-$dir/rockbox-maps.zip";
|
2011-02-20 20:07:41 +00:00
|
|
|
my $elf="build-$dir/rockbox-elfs.zip";
|
2008-10-14 20:44:49 +00:00
|
|
|
if (-f $o) {
|
|
|
|
my $newo="output/rockbox-$dir-$version.zip";
|
2011-02-20 19:27:09 +00:00
|
|
|
my $newmap="output/rockbox-$dir-$version-maps.zip";
|
2011-02-20 20:07:41 +00:00
|
|
|
my $newelf="output/rockbox-$dir-$version-elfs.zip";
|
2008-10-14 20:44:49 +00:00
|
|
|
system("mkdir -p output");
|
|
|
|
system("mv $o $newo");
|
|
|
|
print "moved $o to $newo\n" if($verbose);
|
2011-02-20 19:27:09 +00:00
|
|
|
system("mv $map $newmap");
|
|
|
|
print "moved $map to $newmap\n" if($verbose);
|
2011-02-20 20:07:41 +00:00
|
|
|
system("mv $elf $newelf");
|
|
|
|
print "moved $elf to $newelf\n" if($verbose);
|
2008-10-14 20:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
print "remove all contents in build-$dir\n" if($verbose);
|
|
|
|
system("rm -rf build-$dir");
|
|
|
|
|
|
|
|
return $a;
|
|
|
|
};
|
|
|
|
|
|
|
|
sub fonts {
|
|
|
|
my ($dir, $confnum, $newl)=@_;
|
|
|
|
my $a;
|
|
|
|
|
|
|
|
if($doonly && ($doonly ne $dir)) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
mkdir "build-$dir";
|
|
|
|
chdir "build-$dir";
|
|
|
|
print "Build fonts in build-$dir\n" if($verbose);
|
|
|
|
|
2009-12-07 12:19:08 +00:00
|
|
|
# build the fonts
|
2008-10-14 20:44:49 +00:00
|
|
|
$a = buildfonts($dir, $confnum, $newl);
|
|
|
|
|
|
|
|
chdir "..";
|
|
|
|
|
|
|
|
my $o="build-$dir/rockbox-fonts.zip";
|
|
|
|
if (-f $o) {
|
|
|
|
my $newo="output/rockbox-fonts-$version.zip";
|
|
|
|
system("mv $o $newo");
|
|
|
|
print "moved $o to $newo\n" if($verbose);
|
|
|
|
}
|
|
|
|
|
|
|
|
print "remove all contents in build-$dir\n" if($verbose);
|
|
|
|
system("rm -rf build-$dir");
|
|
|
|
|
|
|
|
return $a;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub buildit {
|
|
|
|
my ($target, $confnum, $extra)=@_;
|
|
|
|
|
|
|
|
`rm -rf * >/dev/null 2>&1`;
|
|
|
|
|
2009-12-07 12:19:08 +00:00
|
|
|
my $ram = $extra ? $extra : -1;
|
|
|
|
my $c = "../tools/configure --type=n --target=$confnum --ram=$ram";
|
2008-10-14 20:44:49 +00:00
|
|
|
|
|
|
|
print "C: $c\n" if($verbose);
|
|
|
|
`$c`;
|
|
|
|
|
|
|
|
print "Run 'make'\n" if($verbose);
|
2011-02-20 19:27:09 +00:00
|
|
|
`make VERSION=$version`;
|
2008-10-14 20:44:49 +00:00
|
|
|
|
|
|
|
print "Run 'make zip'\n" if($verbose);
|
2011-12-07 17:59:11 +00:00
|
|
|
`make zip VERSION=$version`;
|
2008-10-14 20:44:49 +00:00
|
|
|
|
|
|
|
print "Run 'make mapzip'\n" if($verbose);
|
2011-12-07 17:59:11 +00:00
|
|
|
`make mapzip VERSION=$version`;
|
2011-02-20 20:07:41 +00:00
|
|
|
|
|
|
|
print "Run 'make elfzip'\n" if($verbose);
|
2011-12-07 17:59:11 +00:00
|
|
|
`make elfzip VERSION=$version`;
|
2008-10-14 20:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sub buildfonts {
|
|
|
|
my ($target, $confnum, $newl)=@_;
|
|
|
|
|
|
|
|
`rm -rf * >/dev/null 2>&1`;
|
|
|
|
|
2009-12-07 12:19:08 +00:00
|
|
|
my $ram = $extra ? $extra : -1;
|
|
|
|
my $c = "../tools/configure --type=n --target=$confnum --ram=$ram";
|
2008-10-14 20:44:49 +00:00
|
|
|
|
|
|
|
print "C: $c\n" if($verbose);
|
|
|
|
`$c`;
|
|
|
|
|
|
|
|
print "Run 'make fontzip'\n" if($verbose);
|
2010-06-03 21:13:36 +00:00
|
|
|
`make fontzip`;
|
2008-10-14 20:44:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# run make in tools first to make sure they're up-to-date
|
|
|
|
print "cd tools && make\n" if($verbose);
|
2010-06-03 21:13:36 +00:00
|
|
|
`(cd tools && make ) >/dev/null`;
|
2008-10-14 20:44:49 +00:00
|
|
|
|
2009-12-07 12:19:08 +00:00
|
|
|
for my $b (&stablebuilds) {
|
2010-06-04 06:39:28 +00:00
|
|
|
my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b;
|
|
|
|
runone($b, $configname, $builds{$b}{ram});
|
2009-12-07 12:19:08 +00:00
|
|
|
}
|
2008-10-14 20:44:49 +00:00
|
|
|
|
2009-12-07 12:19:08 +00:00
|
|
|
fonts("fonts", "iaudiox5");
|
2008-10-14 20:44:49 +00:00
|
|
|
|