diff options
author | Jonas Häggqvist <rasher@rasher.dk> | 2009-03-06 18:11:51 +0000 |
---|---|---|
committer | Jonas Häggqvist <rasher@rasher.dk> | 2009-03-06 18:11:51 +0000 |
commit | a32b73e9c3461e3917963871c5638234635904da (patch) | |
tree | 0d9d364c18b5be415379a2dfc36ac7f0ce0e59e6 /tools | |
parent | 2b6e4adbd2cd2880e4d94d9519361617bfe8e755 (diff) | |
download | rockbox-a32b73e9c3461e3917963871c5638234635904da.tar.gz rockbox-a32b73e9c3461e3917963871c5638234635904da.zip |
Smarten up the w32sims.pl script and rename it to sims.pl, since it does all sorts of sims now.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20215 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/release/sims.pl | 183 |
1 files changed, 183 insertions, 0 deletions
diff --git a/tools/release/sims.pl b/tools/release/sims.pl new file mode 100755 index 0000000000..932611794b --- /dev/null +++ b/tools/release/sims.pl | |||
@@ -0,0 +1,183 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # This is basically a copy of tools/release/bins.pl, with small changes. | ||
3 | use File::Basename; | ||
4 | use File::Path; | ||
5 | use Cwd; | ||
6 | |||
7 | my $verbose, $update, $doonly, $version; | ||
8 | my @doonly; | ||
9 | |||
10 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time()); | ||
11 | $year+=1900; | ||
12 | $mon+=1; | ||
13 | $verbose=0; | ||
14 | |||
15 | my $filename = "rockbox-sim-<target>-<version>"; | ||
16 | |||
17 | while (scalar @ARGV > 0) { | ||
18 | if ($ARGV[0] eq "-h") { | ||
19 | print $ARGV[0]."\n"; | ||
20 | print <<MOO | ||
21 | Usage: w32sims [-v] [-u] [-r VERSION] [-f filename] [buildonly] | ||
22 | -v Verbose output | ||
23 | -u Run svn up before building | ||
24 | -r Use the specified version string for filenames (defaults to SVN | ||
25 | revision) | ||
26 | -f Filename format string (without extension). This can include a | ||
27 | filepath (relative or absolute) May include the following special | ||
28 | strings: | ||
29 | <version> - Replaced by the revision (or version name if -r is | ||
30 | used) | ||
31 | <target> - Target shortname | ||
32 | <YYYY> - Year (4 digits) | ||
33 | <MM> - Month (2 digits) | ||
34 | <DD> - Day of month (2 digits - 0-padded) | ||
35 | <HH> - Hour of day (2 digits, 0-padded, 00-23) | ||
36 | <mm> - Minute (2 digits, 0-padded) | ||
37 | The default filename is rockbox-sim-<target>-<version> | ||
38 | MOO | ||
39 | ; | ||
40 | exit 1; | ||
41 | } | ||
42 | elsif ($ARGV[0] eq "-v") { | ||
43 | $verbose =1; | ||
44 | } | ||
45 | elsif ($ARGV[0] eq "-u") { | ||
46 | $update =1; | ||
47 | } | ||
48 | elsif ($ARGV[0] eq "-r") { | ||
49 | $version =$ARGV[1]; | ||
50 | shift @ARGV; | ||
51 | } | ||
52 | elsif ($ARGV[0] eq "-f") { | ||
53 | $filename = $ARGV[1]; | ||
54 | shift @ARGV; | ||
55 | } | ||
56 | else { | ||
57 | 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 | } | ||
61 | shift @ARGV; | ||
62 | } | ||
63 | |||
64 | if($update) { | ||
65 | # svn update! | ||
66 | system("svn -q up"); | ||
67 | } | ||
68 | |||
69 | $test = `sdl-config --libs`; | ||
70 | if ($test eq "") { | ||
71 | printf("You don't appear to have sdl-config\n"); | ||
72 | die(); | ||
73 | } | ||
74 | |||
75 | $rev = `tools/version.sh .`; | ||
76 | chomp $rev; | ||
77 | print "rev $rev\n" if($verbose); | ||
78 | |||
79 | if (!defined($version)) { | ||
80 | $version = $rev; | ||
81 | } | ||
82 | |||
83 | # made once for all targets | ||
84 | sub runone { | ||
85 | my ($dir, $confnum, $extra)=@_; | ||
86 | my $a; | ||
87 | |||
88 | if(!grep(/$dir/, @doonly)) { | ||
89 | return; | ||
90 | } | ||
91 | |||
92 | mkdir "build-$dir"; | ||
93 | chdir "build-$dir"; | ||
94 | print "Build in build-$dir\n" if($verbose); | ||
95 | |||
96 | # build the target | ||
97 | $a = buildit($dir, $confnum, $extra); | ||
98 | |||
99 | chdir ".."; | ||
100 | |||
101 | my $newo=$filename; | ||
102 | |||
103 | $newo =~ s/<version>/$version/g; | ||
104 | $newo =~ s/<target>/$dir/g; | ||
105 | $newo =~ s/<YYYY>/$year/g; | ||
106 | $newo =~ s/<MM>/$mon/g; | ||
107 | $newo =~ s/<DD>/$mday/g; | ||
108 | $newo =~ s/<HH>/$hour/g; | ||
109 | $newo =~ s/<mm>/$min/g; | ||
110 | |||
111 | |||
112 | 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)); | ||
116 | system("mv build-$dir $newo"); | ||
117 | if (-f "$newo/rockboxui.exe") { | ||
118 | print "Find and copy SDL.dll\n" if ($verbose); | ||
119 | `cp \`dirname \\\`which sdl-config\\\`\`/SDL.dll ./$newo/`; | ||
120 | } | ||
121 | my $toplevel = getcwd(); | ||
122 | chdir(dirname($newo)); | ||
123 | print(getcwd()."\n"); | ||
124 | $cmd = "zip -9 -r -q ".basename($newo)." ".basename($newo)."/{rockboxui*,UI256.bmp,SDL.dll,simdisk}"; | ||
125 | print("$cmd\n"); | ||
126 | `$cmd`; | ||
127 | chdir($toplevel); | ||
128 | |||
129 | print "remove all contents in $newo\n" if($verbose); | ||
130 | # system("rm -rf $newo"); | ||
131 | |||
132 | return $a; | ||
133 | }; | ||
134 | |||
135 | sub buildit { | ||
136 | my ($target, $confnum, $extra)=@_; | ||
137 | |||
138 | `rm -rf * >/dev/null 2>&1`; | ||
139 | |||
140 | my $c = sprintf('printf "%s\n%ss\n" | ../tools/configure', | ||
141 | $confnum, $extra); | ||
142 | |||
143 | print "C: $c\n" if($verbose); | ||
144 | `$c`; | ||
145 | |||
146 | print "Run 'make'\n" if($verbose); | ||
147 | `make 2>/dev/null`; | ||
148 | |||
149 | print "Run 'make install'\n" if($verbose); | ||
150 | `make install 2>/dev/null`; | ||
151 | } | ||
152 | |||
153 | runone("player", "player", '\n'); | ||
154 | runone("recorder", "recorder", '\n'); | ||
155 | runone("recorder8mb", "recorder", '8\n'); | ||
156 | runone("fmrecorder", "fmrecorder", '\n'); | ||
157 | runone("fmrecorder8mb", "fmrecorder", '8\n'); | ||
158 | runone("recorderv2", "recorderv2", '\n'); | ||
159 | runone("ondiosp", "ondiosp", '\n'); | ||
160 | runone("ondiofm", "ondiofm", '\n'); | ||
161 | runone("h100", "h100"); | ||
162 | runone("h120", "h120"); | ||
163 | runone("h300", "h300"); | ||
164 | runone("ipodcolor", "ipodcolor"); | ||
165 | runone("ipodnano", "ipodnano"); | ||
166 | runone("ipod4gray", "ipod4g"); | ||
167 | runone("ipodvideo", "ipodvideo", '32\n'); | ||
168 | runone("ipodvideo64mb", "ipodvideo", '64\n'); | ||
169 | runone("ipod3g", "ipod3g"); | ||
170 | runone("ipod1g2g", "ipod1g2g"); | ||
171 | runone("iaudiox5", "x5"); | ||
172 | runone("iaudiom5", "m5"); | ||
173 | runone("iaudiom3", "m3"); | ||
174 | runone("ipodmini1g", "ipodmini"); | ||
175 | runone("ipodmini2g", "ipodmini2g"); | ||
176 | runone("h10", "h10"); | ||
177 | runone("h10_5gb", "h10_5gb"); | ||
178 | runone("gigabeatf", "gigabeatf"); | ||
179 | runone("sansae200", "e200"); | ||
180 | runone("sansac200", "c200"); | ||
181 | #runone("mrobe500", "mrobe500"); | ||
182 | runone("mrobe100", "mrobe100"); | ||
183 | runone("cowond2", "cowond2"); | ||