summaryrefslogtreecommitdiff
path: root/tools/buildzip.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/buildzip.pl')
-rwxr-xr-xtools/buildzip.pl84
1 files changed, 67 insertions, 17 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index 3eb974c10d..1000363af7 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -64,6 +64,45 @@ my $firmdir="$ROOT/firmware";
64 64
65my $cppdef = $target; 65my $cppdef = $target;
66 66
67sub gettargetinfo {
68 open(GCC, ">gcctemp");
69 # Get the LCD screen depth and graphical status
70 print GCC <<STOP
71\#include "config.h"
72#ifdef HAVE_LCD_BITMAP
73Bitmap: yes
74Depth: LCD_DEPTH
75#endif
76Codec: CONFIG_CODEC
77STOP
78;
79 close(gcc);
80
81 my $c="cat gcctemp | gcc $cppdef -I. -I$firmdir/export -E -P -";
82
83 # print STDERR "CMD $c\n";
84
85 open(TARGET, "$c|");
86
87 my ($bitmap, $depth, $swcodec);
88 while(<TARGET>) {
89 # print STDERR "DATA: $_";
90 if($_ =~ /^Bitmap: (.*)/) {
91 $bitmap = $1;
92 }
93 elsif($_ =~ /^Depth: (\d*)/) {
94 $depth = $1;
95 }
96 elsif($_ =~ /^Codec: (\d*)/) {
97 # SWCODEC is 1, the others are HWCODEC
98 $swcodec = ($1 == 1);
99 }
100 }
101 close(TARGET);
102 unlink("gcctemp");
103
104 return ($bitmap, $depth, $swcodec);
105}
67 106
68sub filesize { 107sub filesize {
69 my ($filename)=@_; 108 my ($filename)=@_;
@@ -89,13 +128,22 @@ sub buildlangs {
89} 128}
90 129
91sub buildzip { 130sub buildzip {
92 my ($zip, $image, $notplayer, $fonts)=@_; 131 my ($zip, $image, $fonts)=@_;
132
133 my ($bitmap, $depth, $swcodec) = &gettargetinfo();
134
135 print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n";
93 136
94 # remove old traces 137 # remove old traces
95 `rm -rf .rockbox`; 138 `rm -rf .rockbox`;
96 139
97 mkdir ".rockbox", 0777; 140 mkdir ".rockbox", 0777;
98 141
142 if(!$bitmap) {
143 # always disable fonts on non-bitmap targets
144 $fonts = 0;
145 }
146
99 if($fonts) { 147 if($fonts) {
100 mkdir ".rockbox/fonts", 0777; 148 mkdir ".rockbox/fonts", 0777;
101 149
@@ -122,15 +170,22 @@ sub buildzip {
122 170
123 mkdir ".rockbox/langs", 0777; 171 mkdir ".rockbox/langs", 0777;
124 mkdir ".rockbox/rocks", 0777; 172 mkdir ".rockbox/rocks", 0777;
125 if($notplayer) { 173
126 mkdir ".rockbox/codepages", 0777; 174 if($swcodec) {
127 mkdir ".rockbox/codecs", 0777;
128 mkdir ".rockbox/wps", 0777;
129 mkdir ".rockbox/themes", 0777;
130 mkdir ".rockbox/backdrops", 0777;
131 mkdir ".rockbox/eqs", 0777; 175 mkdir ".rockbox/eqs", 0777;
132 176
133 `cp $ROOT/apps/eqs/*.cfg .rockbox/eqs/`; # equalizer presets 177 `cp $ROOT/apps/eqs/*.cfg .rockbox/eqs/`; # equalizer presets
178 }
179
180 mkdir ".rockbox/wps", 0777;
181
182 if($bitmap) {
183 mkdir ".rockbox/codepages", 0777;
184 mkdir ".rockbox/codecs", 0777;
185 mkdir ".rockbox/themes", 0777;
186 if($depth > 1) {
187 mkdir ".rockbox/backdrops", 0777;
188 }
134 189
135 my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \; 2>/dev/null'; 190 my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \; 2>/dev/null';
136 `$c`; 191 `$c`;
@@ -203,7 +258,7 @@ sub buildzip {
203 258
204 `cp $ROOT/apps/tagnavi.config .rockbox/`; 259 `cp $ROOT/apps/tagnavi.config .rockbox/`;
205 260
206 if($notplayer) { 261 if($bitmap) {
207 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels 262 `cp $ROOT/apps/plugins/sokoban.levels .rockbox/rocks/`; # sokoban levels
208 `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels 263 `cp $ROOT/apps/plugins/snake2.levels .rockbox/rocks/`; # snake2 levels
209 } 264 }
@@ -266,11 +321,10 @@ $shortdate=sprintf("%02d%02d%02d", $year%100,$mon, $mday);
266 321
267# made once for all targets 322# made once for all targets
268sub runone { 323sub runone {
269 my ($type, $target, $fonts)=@_; 324 my ($target, $fonts)=@_;
270 325
271 # build a full install .rockbox directory 326 # build a full install .rockbox directory
272 buildzip($output, $target, 327 buildzip($output, $target, $fonts);
273 ($type eq "player")?0:1, $fonts);
274 328
275 # create a zip file from the .rockbox dfir 329 # create a zip file from the .rockbox dfir
276 330
@@ -308,10 +362,6 @@ elsif($exe =~ /rockboxui/) {
308 $exe = ""; 362 $exe = "";
309} 363}
310 364
311if($target =~ /player/i) { 365runone($exe, $incfonts);
312 runone("player", $exe, 0); 366
313}
314else {
315 runone("recorder", $exe, $incfonts);
316}
317 367