diff options
Diffstat (limited to 'tools/release/bins.pl')
-rwxr-xr-x | tools/release/bins.pl | 77 |
1 files changed, 26 insertions, 51 deletions
diff --git a/tools/release/bins.pl b/tools/release/bins.pl index 03333a5963..2457558242 100755 --- a/tools/release/bins.pl +++ b/tools/release/bins.pl | |||
@@ -1,7 +1,5 @@ | |||
1 | #!/usr/bin/perl | 1 | #!/usr/bin/perl |
2 | $version="3.15"; | 2 | require "./tools/builds.pm"; |
3 | |||
4 | require "tools/builds.pm"; | ||
5 | 3 | ||
6 | my $verbose; | 4 | my $verbose; |
7 | if($ARGV[0] eq "-v") { | 5 | if($ARGV[0] eq "-v") { |
@@ -9,53 +7,35 @@ if($ARGV[0] eq "-v") { | |||
9 | shift @ARGV; | 7 | shift @ARGV; |
10 | } | 8 | } |
11 | 9 | ||
12 | my $update; | 10 | my $tag = $ARGV[0]; |
13 | if($ARGV[0] eq "-u") { | 11 | my $version = $ARGV[1]; |
14 | $update =1; | ||
15 | shift @ARGV; | ||
16 | } | ||
17 | |||
18 | my $doonly; | ||
19 | if($ARGV[0]) { | ||
20 | $doonly = $ARGV[0]; | ||
21 | print "only build $doonly\n" if($verbose); | ||
22 | } | ||
23 | 12 | ||
24 | if($update) { | 13 | my $outdir = "output/bins"; |
25 | # svn update! | ||
26 | system("svn -q up"); | ||
27 | } | ||
28 | 14 | ||
29 | $rev = `svnversion`; | 15 | my $cpus = `nproc`; |
30 | chomp $rev; | ||
31 | print "rev $rev\n" if($verbose); | ||
32 | 16 | ||
33 | # made once for all targets | 17 | # made once for all targets |
34 | sub runone { | 18 | sub runone { |
35 | my ($dir, $confnum, $extra)=@_; | 19 | my ($dir, $confnum, $extra)=@_; |
36 | my $a; | 20 | my $a; |
37 | 21 | ||
38 | if($doonly && ($doonly ne $dir)) { | 22 | mkdir "buildb-$dir"; |
39 | return; | 23 | chdir "buildb-$dir"; |
40 | } | 24 | print "Build in buildb-$dir\n" if($verbose); |
41 | |||
42 | mkdir "build-$dir"; | ||
43 | chdir "build-$dir"; | ||
44 | print "Build in build-$dir\n" if($verbose); | ||
45 | 25 | ||
46 | # build the manual(s) | 26 | # build the manual(s) |
47 | $a = buildit($dir, $confnum, $extra); | 27 | $a = buildit($dir, $confnum, $extra); |
48 | 28 | ||
49 | chdir ".."; | 29 | chdir ".."; |
50 | 30 | ||
51 | my $o="build-$dir/rockbox.zip"; | 31 | my $o="buildb-$dir/rockbox.zip"; |
52 | my $map="build-$dir/rockbox-maps.zip"; | 32 | my $map="buildb-$dir/rockbox-maps.zip"; |
53 | my $elf="build-$dir/rockbox-elfs.zip"; | 33 | my $elf="buildb-$dir/rockbox-elfs.zip"; |
54 | if (-f $o) { | 34 | if (-f $o) { |
55 | my $newo="output/rockbox-$dir-$version.zip"; | 35 | my $newo="$outdir/rockbox-$dir-$version.zip"; |
56 | my $newmap="output/rockbox-$dir-$version-maps.zip"; | 36 | my $newmap="$outdir/rockbox-$dir-$version-maps.zip"; |
57 | my $newelf="output/rockbox-$dir-$version-elfs.zip"; | 37 | my $newelf="$outdir/rockbox-$dir-$version-elfs.zip"; |
58 | system("mkdir -p output"); | 38 | system("mkdir -p $outdir"); |
59 | system("mv $o $newo"); | 39 | system("mv $o $newo"); |
60 | print "moved $o to $newo\n" if($verbose); | 40 | print "moved $o to $newo\n" if($verbose); |
61 | system("mv $map $newmap"); | 41 | system("mv $map $newmap"); |
@@ -74,34 +54,28 @@ sub fonts { | |||
74 | my ($dir, $confnum, $newl)=@_; | 54 | my ($dir, $confnum, $newl)=@_; |
75 | my $a; | 55 | my $a; |
76 | 56 | ||
77 | if($doonly && ($doonly ne $dir)) { | 57 | mkdir "buildf-$dir"; |
78 | return; | 58 | chdir "buildf-$dir"; |
79 | } | 59 | print "Build fonts in buildf-$dir\n" if($verbose); |
80 | |||
81 | mkdir "build-$dir"; | ||
82 | chdir "build-$dir"; | ||
83 | print "Build fonts in build-$dir\n" if($verbose); | ||
84 | 60 | ||
85 | # build the fonts | 61 | # build the fonts |
86 | $a = buildfonts($dir, $confnum, $newl); | 62 | $a = buildfonts($dir, $confnum, $newl); |
87 | 63 | ||
88 | chdir ".."; | 64 | chdir ".."; |
89 | 65 | ||
90 | my $o="build-$dir/rockbox-fonts.zip"; | 66 | my $o="buildf-$dir/rockbox-fonts.zip"; |
91 | if (-f $o) { | 67 | if (-f $o) { |
92 | my $newo="output/rockbox-fonts-$version.zip"; | 68 | my $newo="$outdir/rockbox-fonts-$version.zip"; |
93 | system("mv $o $newo"); | 69 | system("mv $o $newo"); |
94 | print "moved $o to $newo\n" if($verbose); | 70 | print "moved $o to $newo\n" if($verbose); |
95 | } | 71 | } |
96 | 72 | ||
97 | print "remove all contents in build-$dir\n" if($verbose); | 73 | print "remove all contents in buildb-$dir\n" if($verbose); |
98 | system("rm -rf build-$dir"); | 74 | system("rm -rf buildf-$dir"); |
99 | 75 | ||
100 | return $a; | 76 | return $a; |
101 | }; | 77 | }; |
102 | 78 | ||
103 | |||
104 | |||
105 | sub buildit { | 79 | sub buildit { |
106 | my ($target, $confnum, $extra)=@_; | 80 | my ($target, $confnum, $extra)=@_; |
107 | 81 | ||
@@ -114,7 +88,7 @@ sub buildit { | |||
114 | `$c`; | 88 | `$c`; |
115 | 89 | ||
116 | print "Run 'make'\n" if($verbose); | 90 | print "Run 'make'\n" if($verbose); |
117 | `make VERSION=$version`; | 91 | `make -j$cpus VERSION=$version`; |
118 | 92 | ||
119 | print "Run 'make zip'\n" if($verbose); | 93 | print "Run 'make zip'\n" if($verbose); |
120 | `make zip VERSION=$version`; | 94 | `make zip VERSION=$version`; |
@@ -141,14 +115,15 @@ sub buildfonts { | |||
141 | `make fontzip`; | 115 | `make fontzip`; |
142 | } | 116 | } |
143 | 117 | ||
118 | `git checkout $tag`; | ||
119 | |||
144 | # run make in tools first to make sure they're up-to-date | 120 | # run make in tools first to make sure they're up-to-date |
145 | print "cd tools && make\n" if($verbose); | 121 | print "cd tools && make\n" if($verbose); |
146 | `(cd tools && make ) >/dev/null`; | 122 | `(cd tools && make ) >/dev/null`; |
147 | 123 | ||
148 | for my $b (&stablebuilds) { | 124 | for my $b (&usablebuilds) { |
149 | my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; | 125 | my $configname = $builds{$b}{configname} ? $builds{$b}{configname} : $b; |
150 | runone($b, $configname, $builds{$b}{ram}); | 126 | runone($b, $configname, $builds{$b}{ram}); |
151 | } | 127 | } |
152 | 128 | ||
153 | fonts("fonts", "iaudiox5"); | 129 | fonts("fonts", "iaudiox5"); |
154 | |||