first step at building the main binary
[kugel-rb.git] / tools / release / manuals.pl
blob3992da53d267a78a4692e314ed0bbdc31982b0c8
1 #!/usr/bin/perl
3 $version="3.0";
5 require "tools/builds.pm";
7 my $verbose;
8 if($ARGV[0] eq "-v") {
9 $verbose =1;
10 shift @ARGV;
13 my $doonly;
14 if($ARGV[0]) {
15 $doonly = $ARGV[0];
16 print "only build $doonly\n" if($verbose);
19 # made once for all targets
20 sub runone {
21 my ($dir)=@_;
22 my $a;
24 if($doonly && ($doonly ne $dir)) {
25 return;
28 mkdir "buildm-$dir";
29 chdir "buildm-$dir";
30 print "Build in buildm-$dir\n" if($verbose);
32 # build the manual(s)
33 $a = buildit($dir);
35 chdir "..";
37 my $o="buildm-$dir/manual/rockbox-build.pdf";
38 if (-f $o) {
39 my $newo="output/rockbox-$dir-$version.pdf";
40 system("mv $o $newo");
41 print "moved $o to $newo\n" if($verbose);
44 $o="buildm-$dir/rockbox-manual.zip";
45 if (-f $o) {
46 my $newo="output/rockbox-$dir-$version-html.zip";
47 system("mv $o $newo");
48 print "moved $o to $newo\n" if($verbose);
51 print "remove all contents in buildm-$dir\n" if($verbose);
52 system("rm -rf buildm-$dir");
54 return $a;
57 sub buildit {
58 my ($target)=@_;
60 `rm -rf * >/dev/null 2>&1`;
62 my $c = "../tools/configure --target=$target --type=m --ram=0";
64 print "C: $c\n" if($verbose);
65 `$c`;
67 print "Run 'make'\n" if($verbose);
68 `make manual 2>/dev/null`;
70 print "Run 'make manual-zip'\n" if($verbose);
71 `make manual-zip 2>/dev/null`;
74 # run make in tools first to make sure they're up-to-date
75 `(cd tools && make ) >/dev/null 2>&1`;
77 for my $b (&stablebuilds) {
78 next if (length($builds{$b}{configname}) > 0); # no variants
80 runone($b);