Add initial Packard Bell Vibe 500 port, by Szymon Dziok
[kugel-rb.git] / tools / release / manuals.pl
blob368d31ac0b41283c4cf62c0bc300be81e061b00c
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 "buildm-$dir";
27 chdir "buildm-$dir";
28 print "Build in buildm-$dir\n" if($verbose);
30 # build the manual(s)
31 $a = buildit($dir);
33 chdir "..";
35 my $o="buildm-$dir/manual/rockbox-build.pdf";
36 if (-f $o) {
37 my $newo="output/rockbox-$dir-$version.pdf";
38 system("mv $o $newo");
39 print "moved $o to $newo\n" if($verbose);
42 $o="buildm-$dir/rockbox-manual.zip";
43 if (-f $o) {
44 my $newo="output/rockbox-$dir-$version-html.zip";
45 system("mv $o $newo");
46 print "moved $o to $newo\n" if($verbose);
49 print "remove all contents in buildm-$dir\n" if($verbose);
50 system("rm -rf buildm-$dir");
52 return $a;
55 sub buildit {
56 my ($target)=@_;
58 `rm -rf * >/dev/null 2>&1`;
60 my $c = "../tools/configure --target=$target --type=m";
62 print "C: $c\n" if($verbose);
63 `$c`;
65 print "Run 'make'\n" if($verbose);
66 `make manual 2>/dev/null`;
68 print "Run 'make manual-zip'\n" if($verbose);
69 `make manual-zip 2>/dev/null`;
72 # run make in tools first to make sure they're up-to-date
73 `(cd tools && make ) >/dev/null 2>&1`;
75 for my $b (&stablebuilds) {
76 next if ($builds{$b}{configname} < 3); # no variants
78 runone($b);