diff options
-rwxr-xr-x | tools/release/w32sims.pl | 144 |
1 files changed, 144 insertions, 0 deletions
diff --git a/tools/release/w32sims.pl b/tools/release/w32sims.pl new file mode 100755 index 0000000000..058e2bb302 --- /dev/null +++ b/tools/release/w32sims.pl | |||
@@ -0,0 +1,144 @@ | |||
1 | #!/usr/bin/perl | ||
2 | # This is basically a copy of tools/release/bins.pl, with small changes | ||
3 | # You need to set up $PATH to include the bin dir of a crosscompiled SDL | ||
4 | # installation, and have mingw32 compilers installed. Everything else should | ||
5 | # Just Work[tm]. | ||
6 | |||
7 | my $verbose, $update, $doonly, $version; | ||
8 | while (scalar @ARGV > 0) { | ||
9 | if ($ARGV[0] eq "-h") { | ||
10 | print $ARGV[0]."\n"; | ||
11 | print <<MOO | ||
12 | Usage: w32sims [-v] [-u] [-r VERSION] [buildonly] | ||
13 | -v Verbose output | ||
14 | -u Run svn up before building | ||
15 | -r Use the specified version string for filenames (defaults to SVN | ||
16 | revision) | ||
17 | MOO | ||
18 | ; | ||
19 | exit 1; | ||
20 | } | ||
21 | elsif ($ARGV[0] eq "-v") { | ||
22 | $verbose =1; | ||
23 | } | ||
24 | elsif ($ARGV[0] eq "-u") { | ||
25 | $update =1; | ||
26 | } | ||
27 | elsif ($ARGV[0] eq "-r") { | ||
28 | $version =$ARGV[1]; | ||
29 | shift @ARGV; | ||
30 | } | ||
31 | else { | ||
32 | $doonly =$ARGV[0]; | ||
33 | # This will only be printed if the -v flag comes earler | ||
34 | print "only build $doonly\n" if($verbose); | ||
35 | } | ||
36 | shift @ARGV; | ||
37 | } | ||
38 | |||
39 | if($update) { | ||
40 | # svn update! | ||
41 | system("svn -q up"); | ||
42 | } | ||
43 | |||
44 | $rev = `svnversion`; | ||
45 | chomp $rev; | ||
46 | print "rev $rev\n" if($verbose); | ||
47 | |||
48 | if (!defined($version)) { | ||
49 | $version = sprintf("r%d", $rev); | ||
50 | } | ||
51 | |||
52 | # made once for all targets | ||
53 | sub runone { | ||
54 | my ($dir, $confnum, $extra)=@_; | ||
55 | my $a; | ||
56 | |||
57 | if($doonly && ($doonly ne $dir)) { | ||
58 | return; | ||
59 | } | ||
60 | |||
61 | mkdir "build-$dir"; | ||
62 | chdir "build-$dir"; | ||
63 | print "Build in build-$dir\n" if($verbose); | ||
64 | |||
65 | # build the target | ||
66 | $a = buildit($dir, $confnum, $extra); | ||
67 | |||
68 | chdir ".."; | ||
69 | |||
70 | print "Zip up the sim and associated files\n" if ($verbose); | ||
71 | system("mv build-$dir rockbox-$dir-w32-sim"); | ||
72 | `zip -9 -r -q rockbox-$dir-w32-sim/rockbox.zip rockbox-$dir-w32-sim/{rockboxui.exe,UI256.bmp,SDL.dll,archos}`; | ||
73 | |||
74 | my $o="rockbox-$dir-w32-sim/rockbox.zip"; | ||
75 | if (-f $o) { | ||
76 | my $newo="output/rockbox-$dir-$version-w32-sim.zip"; | ||
77 | system("mkdir -p output"); | ||
78 | system("mv $o $newo"); | ||
79 | print "moved $o to $newo\n" if($verbose); | ||
80 | } | ||
81 | |||
82 | print "remove all contents in rockbox-$dir-w32-sim\n" if($verbose); | ||
83 | system("rm -rf rockbox-$dir-w32-sim"); | ||
84 | |||
85 | return $a; | ||
86 | }; | ||
87 | |||
88 | sub buildit { | ||
89 | my ($target, $confnum, $extra)=@_; | ||
90 | |||
91 | `rm -rf * >/dev/null 2>&1`; | ||
92 | |||
93 | my $c = sprintf('printf "%s\n%ss\n" | ../tools/configure', | ||
94 | $confnum, $extra); | ||
95 | |||
96 | print "C: $c\n" if($verbose); | ||
97 | `$c`; | ||
98 | |||
99 | print "Run 'make'\n" if($verbose); | ||
100 | `make -j 2>/dev/null`; | ||
101 | |||
102 | print "Run 'make install'\n" if($verbose); | ||
103 | `make install 2>/dev/null`; | ||
104 | |||
105 | print "Find and copy SDL.dll\n" if ($verbose); | ||
106 | `cp \`dirname \\\`which sdl-config\\\`\`/SDL.dll ./`; | ||
107 | |||
108 | } | ||
109 | |||
110 | # run make in tools first to make sure they're up-to-date | ||
111 | print "cd tools && make\n" if($verbose); | ||
112 | `(cd tools && make ) >/dev/null 2>&1`; | ||
113 | |||
114 | runone("player", "player", '\n'); | ||
115 | runone("recorder", "recorder", '\n'); | ||
116 | runone("recorder8mb", "recorder", '8\n'); | ||
117 | runone("fmrecorder", "fmrecorder", '\n'); | ||
118 | runone("fmrecorder8mb", "fmrecorder", '8\n'); | ||
119 | runone("recorderv2", "recorderv2", '\n'); | ||
120 | runone("ondiosp", "ondiosp", '\n'); | ||
121 | runone("ondiofm", "ondiofm", '\n'); | ||
122 | runone("h100", "h100"); | ||
123 | runone("h120", "h120"); | ||
124 | runone("h300", "h300"); | ||
125 | runone("ipodcolor", "ipodcolor"); | ||
126 | runone("ipodnano", "ipodnano"); | ||
127 | runone("ipod4gray", "ipod4g"); | ||
128 | runone("ipodvideo", "ipodvideo", '32\n'); | ||
129 | runone("ipodvideo64mb", "ipodvideo", '64\n'); | ||
130 | runone("ipod3g", "ipod3g"); | ||
131 | runone("ipod1g2g", "ipod1g2g"); | ||
132 | runone("iaudiox5", "x5"); | ||
133 | runone("iaudiom5", "m5"); | ||
134 | runone("iaudiom3", "m3"); | ||
135 | runone("ipodmini1g", "ipodmini"); | ||
136 | runone("ipodmini2g", "ipodmini2g"); | ||
137 | runone("h10", "h10"); | ||
138 | runone("h10_5gb", "h10_5gb"); | ||
139 | runone("gigabeatf", "gigabeatf"); | ||
140 | runone("sansae200", "e200"); | ||
141 | runone("sansac200", "c200"); | ||
142 | #runone("mrobe500", "mrobe500"); | ||
143 | runone("mrobe100", "mrobe100"); | ||
144 | runone("cowond2", "cowond2"); | ||