blob: 923cacf747cace746207e3e2a6379995626abc23 [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
28 mkdir "buildm-$dir";
29 chdir "buildm-$dir";
30 print "Build in buildm-$dir\n" if($verbose);
31
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
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);
42 }
43
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);
49 }
50
51 print "remove all contents in buildm-$dir\n" if($verbose);
52 system("rm -rf buildm-$dir");
53
54 return $a;
55};
56
57sub buildit {
Björn Stenbergc0740442009-12-07 12:19:08 +000058 my ($target)=@_;
Daniel Stenberg7728c942008-10-14 20:44:49 +000059
60 `rm -rf * >/dev/null 2>&1`;
61
Frank Gevaertsbf17fcb2010-06-03 21:04:02 +000062 my $c = "../tools/configure --target=$target --type=m --ram=0";
Daniel Stenberg7728c942008-10-14 20:44:49 +000063
64 print "C: $c\n" if($verbose);
65 `$c`;
66
67 print "Run 'make'\n" if($verbose);
Frank Gevaertsd0731062011-12-07 17:59:11 +000068 `make manual VERSION=$version 2>/dev/null`;
Daniel Stenberg7728c942008-10-14 20:44:49 +000069
70 print "Run 'make manual-zip'\n" if($verbose);
Frank Gevaertsd0731062011-12-07 17:59:11 +000071 `make manual-zip VERSION=$version 2>/dev/null`;
Daniel Stenberg7728c942008-10-14 20:44:49 +000072}
73
74# run make in tools first to make sure they're up-to-date
75`(cd tools && make ) >/dev/null 2>&1`;
76
Björn Stenbergc0740442009-12-07 12:19:08 +000077for my $b (&stablebuilds) {
Frank Gevaerts211e54c2010-06-03 20:56:24 +000078 next if (length($builds{$b}{configname}) > 0); # no variants
Björn Stenbergc0740442009-12-07 12:19:08 +000079
80 runone($b);
81}