summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/release/sims.pl183
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.
3use File::Basename;
4use File::Path;
5use Cwd;
6
7my $verbose, $update, $doonly, $version;
8my @doonly;
9
10my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time());
11$year+=1900;
12$mon+=1;
13$verbose=0;
14
15my $filename = "rockbox-sim-<target>-<version>";
16
17while (scalar @ARGV > 0) {
18 if ($ARGV[0] eq "-h") {
19 print $ARGV[0]."\n";
20 print <<MOO
21Usage: 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>
38MOO
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
64if($update) {
65 # svn update!
66 system("svn -q up");
67}
68
69$test = `sdl-config --libs`;
70if ($test eq "") {
71 printf("You don't appear to have sdl-config\n");
72 die();
73}
74
75$rev = `tools/version.sh .`;
76chomp $rev;
77print "rev $rev\n" if($verbose);
78
79if (!defined($version)) {
80 $version = $rev;
81}
82
83# made once for all targets
84sub 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
135sub 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
153runone("player", "player", '\n');
154runone("recorder", "recorder", '\n');
155runone("recorder8mb", "recorder", '8\n');
156runone("fmrecorder", "fmrecorder", '\n');
157runone("fmrecorder8mb", "fmrecorder", '8\n');
158runone("recorderv2", "recorderv2", '\n');
159runone("ondiosp", "ondiosp", '\n');
160runone("ondiofm", "ondiofm", '\n');
161runone("h100", "h100");
162runone("h120", "h120");
163runone("h300", "h300");
164runone("ipodcolor", "ipodcolor");
165runone("ipodnano", "ipodnano");
166runone("ipod4gray", "ipod4g");
167runone("ipodvideo", "ipodvideo", '32\n');
168runone("ipodvideo64mb", "ipodvideo", '64\n');
169runone("ipod3g", "ipod3g");
170runone("ipod1g2g", "ipod1g2g");
171runone("iaudiox5", "x5");
172runone("iaudiom5", "m5");
173runone("iaudiom3", "m3");
174runone("ipodmini1g", "ipodmini");
175runone("ipodmini2g", "ipodmini2g");
176runone("h10", "h10");
177runone("h10_5gb", "h10_5gb");
178runone("gigabeatf", "gigabeatf");
179runone("sansae200", "e200");
180runone("sansac200", "c200");
181#runone("mrobe500", "mrobe500");
182runone("mrobe100", "mrobe100");
183runone("cowond2", "cowond2");