Fix bins.pl to use the gloabl builds.pm listing
[kugel-rb.git] / tools / release / bins.pl
blobab8282051c520a03b638a4a4f97f46cb97291cb8
1 #!/usr/bin/perl
2 $version="3.5RC";
4 require "tools/builds.pm";
6 my $verbose;
7 if($ARGV[0] eq "-v") {
8 $verbose =1;
9 shift @ARGV;
12 my $update;
13 if($ARGV[0] eq "-u") {
14 $update =1;
15 shift @ARGV;
18 my $doonly;
19 if($ARGV[0]) {
20 $doonly = $ARGV[0];
21 print "only build $doonly\n" if($verbose);
24 if($update) {
25 # svn update!
26 system("svn -q up");
29 $rev = `svnversion`;
30 chomp $rev;
31 print "rev $rev\n" if($verbose);
33 # made once for all targets
34 sub runone {
35 my ($dir, $confnum, $extra)=@_;
36 my $a;
38 if($doonly && ($doonly ne $dir)) {
39 return;
42 mkdir "build-$dir";
43 chdir "build-$dir";
44 print "Build in build-$dir\n" if($verbose);
46 # build the manual(s)
47 $a = buildit($dir, $confnum, $extra);
49 chdir "..";
51 my $o="build-$dir/rockbox.zip";
52 if (-f $o) {
53 my $newo="output/rockbox-$dir-$version.zip";
54 system("mkdir -p output");
55 system("mv $o $newo");
56 print "moved $o to $newo\n" if($verbose);
59 print "remove all contents in build-$dir\n" if($verbose);
60 system("rm -rf build-$dir");
62 return $a;
65 sub fonts {
66 my ($dir, $confnum, $newl)=@_;
67 my $a;
69 if($doonly && ($doonly ne $dir)) {
70 return;
73 mkdir "build-$dir";
74 chdir "build-$dir";
75 print "Build fonts in build-$dir\n" if($verbose);
77 # build the fonts
78 $a = buildfonts($dir, $confnum, $newl);
80 chdir "..";
82 my $o="build-$dir/rockbox-fonts.zip";
83 if (-f $o) {
84 my $newo="output/rockbox-fonts-$version.zip";
85 system("mv $o $newo");
86 print "moved $o to $newo\n" if($verbose);
89 print "remove all contents in build-$dir\n" if($verbose);
90 system("rm -rf build-$dir");
92 return $a;
97 sub buildit {
98 my ($target, $confnum, $extra)=@_;
100 `rm -rf * >/dev/null 2>&1`;
102 my $ram = $extra ? $extra : -1;
103 my $c = "../tools/configure --type=n --target=$confnum --ram=$ram";
105 print "C: $c\n" if($verbose);
106 `$c`;
108 print "Run 'make'\n" if($verbose);
109 `make -j 2>/dev/null`;
111 print "Run 'make zip'\n" if($verbose);
112 `make zip 2>/dev/null`;
114 print "Run 'make mapzip'\n" if($verbose);
115 `make mapzip 2>/dev/null`;
118 sub buildfonts {
119 my ($target, $confnum, $newl)=@_;
121 `rm -rf * >/dev/null 2>&1`;
123 my $ram = $extra ? $extra : -1;
124 my $c = "../tools/configure --type=n --target=$confnum --ram=$ram";
126 print "C: $c\n" if($verbose);
127 `$c`;
129 print "Run 'make fontzip'\n" if($verbose);
130 `make fontzip 2>/dev/null`;
133 # run make in tools first to make sure they're up-to-date
134 print "cd tools && make\n" if($verbose);
135 `(cd tools && make ) >/dev/null 2>&1`;
137 for my $b (&stablebuilds) {
138 my $configname = $builds{b}{configname} ? $builds{b}{configname} : $b;
139 runone($b, $configname, $builds{b}{ram});
142 fonts("fonts", "iaudiox5");