diff options
Diffstat (limited to 'tools/release/sims.pl')
-rwxr-xr-x | tools/release/sims.pl | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/tools/release/sims.pl b/tools/release/sims.pl index fbf868f541..c84041c056 100755 --- a/tools/release/sims.pl +++ b/tools/release/sims.pl | |||
@@ -4,7 +4,7 @@ use File::Basename; | |||
4 | use File::Path; | 4 | use File::Path; |
5 | use Cwd; | 5 | use Cwd; |
6 | 6 | ||
7 | my $verbose, $update, $doonly, $version; | 7 | my $verbose, $strip, $update, $doonly, $version; |
8 | my @doonly; | 8 | my @doonly; |
9 | 9 | ||
10 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); | 10 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); |
@@ -23,6 +23,7 @@ Usage: w32sims [-v] [-u] [-r VERSION] [-f filename] [buildonly] | |||
23 | -u Run svn up before building | 23 | -u Run svn up before building |
24 | -r Use the specified version string for filenames (defaults to SVN | 24 | -r Use the specified version string for filenames (defaults to SVN |
25 | revision) | 25 | revision) |
26 | -s Strip binaries before zipping them up. | ||
26 | -f Filename format string (without extension). This can include a | 27 | -f Filename format string (without extension). This can include a |
27 | filepath (relative or absolute) May include the following special | 28 | filepath (relative or absolute) May include the following special |
28 | strings: | 29 | strings: |
@@ -45,6 +46,9 @@ MOO | |||
45 | elsif ($ARGV[0] eq "-u") { | 46 | elsif ($ARGV[0] eq "-u") { |
46 | $update =1; | 47 | $update =1; |
47 | } | 48 | } |
49 | elsif ($ARGV[0] eq "-s") { | ||
50 | $strip =1; | ||
51 | } | ||
48 | elsif ($ARGV[0] eq "-r") { | 52 | elsif ($ARGV[0] eq "-r") { |
49 | $version =$ARGV[1]; | 53 | $version =$ARGV[1]; |
50 | shift @ARGV; | 54 | shift @ARGV; |
@@ -55,8 +59,6 @@ MOO | |||
55 | } | 59 | } |
56 | else { | 60 | else { |
57 | push(@doonly,$ARGV[0]); | 61 | push(@doonly,$ARGV[0]); |
58 | # This will only be printed if the -v flag comes earler | ||
59 | print "only build ${ARGV[0]}\n" if($verbose); | ||
60 | } | 62 | } |
61 | shift @ARGV; | 63 | shift @ARGV; |
62 | } | 64 | } |
@@ -76,6 +78,10 @@ $rev = `tools/version.sh .`; | |||
76 | chomp $rev; | 78 | chomp $rev; |
77 | print "rev $rev\n" if($verbose); | 79 | print "rev $rev\n" if($verbose); |
78 | 80 | ||
81 | if (@doonly) { | ||
82 | printf("Build only %s\n", join(', ', @doonly)) if($verbose); | ||
83 | } | ||
84 | |||
79 | if (!defined($version)) { | 85 | if (!defined($version)) { |
80 | $version = $rev; | 86 | $version = $rev; |
81 | } | 87 | } |
@@ -96,6 +102,19 @@ sub runone { | |||
96 | # build the target | 102 | # build the target |
97 | $a = buildit($dir, $confnum, $extra); | 103 | $a = buildit($dir, $confnum, $extra); |
98 | 104 | ||
105 | if ($strip) { | ||
106 | print "Stripping binaries\n" if ($verbose); | ||
107 | # find \( -name "*.exe" -o -name "*.rock" -o -name "*.codec" \) -exec ls -l "{}" ";" | ||
108 | open(MAKE, "Makefile"); | ||
109 | my $AS=(grep(/^export AS=/, <MAKE>))[0]; | ||
110 | chomp($AS); | ||
111 | (my $striptool = $AS) =~ s/^export AS=(.*)as$/$1strip/; | ||
112 | |||
113 | $cmd = "find \\( -name 'rockboxui*' -o -iname '*dll' -o -name '*.rock' -o -name '*.codec' \\) -exec $striptool '{}' ';'"; | ||
114 | print("$cmd\n") if ($verbose); | ||
115 | `$cmd`; | ||
116 | } | ||
117 | |||
99 | chdir ".."; | 118 | chdir ".."; |
100 | 119 | ||
101 | my $newo=$filename; | 120 | my $newo=$filename; |
@@ -110,8 +129,6 @@ sub runone { | |||
110 | 129 | ||
111 | 130 | ||
112 | print "Zip up the sim and associated files\n" if ($verbose); | 131 | print "Zip up the sim and associated files\n" if ($verbose); |
113 | print("Output: $newo\n"); | ||
114 | print("Dir: " . dirname($newo) . "\n"); | ||
115 | mkpath(dirname($newo)); | 132 | mkpath(dirname($newo)); |
116 | system("mv build-$dir $newo"); | 133 | system("mv build-$dir $newo"); |
117 | if (-f "$newo/rockboxui.exe") { | 134 | if (-f "$newo/rockboxui.exe") { |
@@ -120,9 +137,8 @@ sub runone { | |||
120 | } | 137 | } |
121 | my $toplevel = getcwd(); | 138 | my $toplevel = getcwd(); |
122 | chdir(dirname($newo)); | 139 | chdir(dirname($newo)); |
123 | print(getcwd()."\n"); | 140 | $cmd = "zip -9 -r -q \"".basename($newo)."\" \"".basename($newo)."\"/{rockboxui*,UI256.bmp,SDL.dll,simdisk}"; |
124 | $cmd = "zip -9 -r -q ".basename($newo)." ".basename($newo)."/{rockboxui*,UI256.bmp,SDL.dll,simdisk}"; | 141 | print("$cmd\n") if($verbose); |
125 | print("$cmd\n"); | ||
126 | `$cmd`; | 142 | `$cmd`; |
127 | chdir($toplevel); | 143 | chdir($toplevel); |
128 | 144 | ||